From 2d65164df213b997f0879f5e82ce1b770804ab67 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Wed, 21 Aug 2024 07:17:47 -0400 Subject: [PATCH] Fix derive.balances.all when data is undefined --- packages/api-derive/src/balances/all.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api-derive/src/balances/all.ts b/packages/api-derive/src/balances/all.ts index a2fe133fb84c..857dd2382345 100644 --- a/packages/api-derive/src/balances/all.ts +++ b/packages/api-derive/src/balances/all.ts @@ -56,7 +56,7 @@ function calcShared (api: DeriveApi, bestNumber: BlockNumber, data: DeriveBalanc const { allLocked, lockedBalance, lockedBreakdown, vestingLocked } = calcLocked(api, bestNumber, locks); let transferable = null; - if (data.frameSystemAccountInfo?.frozen) { + if (data?.frameSystemAccountInfo?.frozen) { const { frameSystemAccountInfo, freeBalance, reservedBalance } = data; const noFrozenReserved = frameSystemAccountInfo.frozen.isZero() && reservedBalance.isZero(); const ED = api.consts.balances.existentialDeposit;