]> git.codecow.com Git - libnemo.git/commitdiff
Fix wallet accounts return.
authorChris Duncan <chris@zoso.dev>
Fri, 8 Aug 2025 19:22:18 +0000 (12:22 -0700)
committerChris Duncan <chris@zoso.dev>
Fri, 8 Aug 2025 19:22:18 +0000 (12:22 -0700)
src/lib/wallet.ts

index 79d9474071eeb0753523c1a11eebd2e7a6450bce..840e9bee69698a0bd326f5284bb95138c7b8ea76 100644 (file)
@@ -277,13 +277,14 @@ export class Wallet {
                                }))\r
                        }\r
                        const publicKeys: KeyPair[] = await Promise.all(promises)\r
-                       if (publicKeys.length === 0) return []\r
-                       const publicAccounts = Account.import(publicKeys)\r
-                       for (const a of publicAccounts) {\r
-                               if (a.index == null) {\r
-                                       throw new RangeError('Index missing for Account')\r
+                       if (publicKeys.length > 0) {\r
+                               const publicAccounts = Account.import(publicKeys)\r
+                               for (const a of publicAccounts) {\r
+                                       if (a.index == null) {\r
+                                               throw new RangeError('Index missing for Account')\r
+                                       }\r
+                                       output[a.index] = this.#accounts[a.index] = a\r
                                }\r
-                               output[a.index] = this.#accounts[a.index] = a\r
                        }\r
                }\r
                return output\r