File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,13 @@ function accountSelect(): WalletCheckModule | never {
51
51
<select id="account-select" onchange="window.accountSelect()" style="padding: 0.5rem;">
52
52
${ accountsAndBalances . map (
53
53
( account : { balance : string ; address : string } ) =>
54
- `<option value="${ account . address } ">${
55
- account . address
56
- } --- ${ new BigNumber ( account . balance )
57
- . div ( '1000000000000000000' )
58
- . toFixed ( 3 ) } ETH</option>`
54
+ `<option value="${ account . address } ">${ account . address } --- ${
55
+ account . balance != null
56
+ ? new BigNumber ( account . balance )
57
+ . div ( '1000000000000000000' )
58
+ . toFixed ( 3 )
59
+ : '0'
60
+ } ETH</option>`
59
61
) }
60
62
</select><button style="background: transparent; margin: 0 0.25rem; padding: 0.25rem 0.5rem; border-radius: 40px; cursor: pointer; color: inherit; border-color: inherit; border-width: 1px;" onclick="window.loadMoreAccounts()">Load More</button>
61
63
` ,
Original file line number Diff line number Diff line change @@ -238,7 +238,13 @@ async function ledgerProvider(options: {
238
238
} ,
239
239
( e : any , res : any ) => {
240
240
e && reject ( e )
241
- resolve ( res && res . result && new BigNumber ( res . result ) . toString ( 10 ) )
241
+ const result = res && res . result
242
+
243
+ if ( result != null ) {
244
+ resolve ( new BigNumber ( result ) . toString ( 10 ) )
245
+ } else {
246
+ resolve ( null )
247
+ }
242
248
}
243
249
)
244
250
} )
Original file line number Diff line number Diff line change @@ -256,7 +256,13 @@ async function trezorProvider(options: {
256
256
} ,
257
257
( e : any , res : any ) => {
258
258
e && reject ( e )
259
- resolve ( res && res . result && new BigNumber ( res . result ) . toString ( 10 ) )
259
+ const result = res && res . result
260
+
261
+ if ( result != null ) {
262
+ resolve ( new BigNumber ( result ) . toString ( 10 ) )
263
+ } else {
264
+ resolve ( null )
265
+ }
260
266
}
261
267
)
262
268
} )
You can’t perform that action at this time.
0 commit comments