Skip to content

Commit c34e0b3

Browse files
committed
fix typeerror?
1 parent fb70480 commit c34e0b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SmartTransactionsController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export default class SmartTransactionsController extends PollingControllerV1<
310310

311311
if (isNewSmartTransaction) {
312312
// add smart transaction
313-
const cancelledNonceIndex = currentSmartTransactions.findIndex(
313+
const cancelledNonceIndex = currentSmartTransactions?.findIndex(
314314
(stx: SmartTransaction) =>
315315
stx.txParams?.nonce === smartTransaction.txParams?.nonce &&
316316
stx.status?.startsWith('cancelled'),
@@ -322,9 +322,9 @@ export default class SmartTransactionsController extends PollingControllerV1<
322322
cancelledNonceIndex > -1
323323
? currentSmartTransactions
324324
.slice(0, cancelledNonceIndex)
325-
.concat(currentSmartTransactions.slice(cancelledNonceIndex + 1))
326-
.concat(historifiedSmartTransaction)
327-
: currentSmartTransactions.concat(historifiedSmartTransaction);
325+
?.concat(currentSmartTransactions.slice(cancelledNonceIndex + 1))
326+
?.concat(historifiedSmartTransaction)
327+
: currentSmartTransactions?.concat(historifiedSmartTransaction);
328328
this.update({
329329
smartTransactionsState: {
330330
...smartTransactionsState,

0 commit comments

Comments
 (0)