iotaledger / trinity-wallet

Trinity is IOTA's old, deprecated wallet. Use Firefly instead.
https://trinity.iota.org
Other
470 stars 120 forks source link

TypeError in src/libs/keychain.js:107 #1367

Open rajivshah3 opened 5 years ago

rajivshah3 commented 5 years ago

Error in Trinity Mobile

TypeError in src/libs/keychain.js:107 null is not an object (evaluating 'n.item')

View on Bugsnag

Stacktrace

src/libs/keychain.js:107 - 

View full stacktrace

Created by Rajiv Shah via Bugsnag

rajivshah3 commented 5 years ago

https://github.com/iotaledger/trinity-wallet/blob/31595ce7463e79da5ca9d0c1bbb75384edab6a5f/src/mobile/src/libs/keychain.js#L105-L109

We should check whether saltItem is null before trying to access the item property. keychain.get may return null if an item is not found in the user's keychain:

https://github.com/iotaledger/trinity-wallet/blob/d52d6b5aa944c79d507bdcc8b3aa235fae9181b2/src/mobile/src/libs/keychain.js#L36-L38