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(); path.createSync();
} }
final wallets = <Wallet>[]; final wallets = <Wallet>[];
for (final w for (final w in path
in path.listSync().map((e) => e.path.split("/").last).toList()) { .listSync()
.whereType<File>()
.where((e) => e.path.endsWith(".json"))
.map((e) => e.path.split("/").last)
.toList()) {
try { try {
wallets.add(loadWallet(w)); wallets.add(loadWallet(w));
} catch (e) { } catch (e) {