fix: only check json files in listWallets

This commit is contained in:
Matyáš Caras 2024-06-30 11:30:33 +02:00
parent 07908797d5
commit 62e0c2ba3d
Signed by: hernik
GPG key ID: 2A3175F98820C5C6

View file

@ -26,8 +26,12 @@ class WalletManager {
path.createSync();
}
final wallets = <Wallet>[];
for (final w
in path.listSync().map((e) => e.path.split("/").last).toList()) {
for (final w in path
.listSync()
.whereType<File>()
.where((e) => e.path.endsWith(".json"))
.map((e) => e.path.split("/").last)
.toList()) {
try {
wallets.add(loadWallet(w));
} catch (e) {