From b182fd2428fcfbd504fc676c7c2995bcade2c254 Mon Sep 17 00:00:00 2001 From: Luke Schoen Date: Thu, 27 Feb 2020 21:28:41 +0100 Subject: [PATCH] fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970) We're converting our chain from PoA to PoS in this PR https://github.com/DataHighway-DHX/node/pull/52/commits/7c8c96939ab6a2b77dd3a2f4bef427e831dafbda But when I run the chain with those latest changes I got error `TypeError: Cannot read property 'vesting' of undefined` when I tried to go to the "Accounts", "Transfer", or "Extrinsics" app using polkadot.js.org/apps, as explained here https://matrix.to/#/!XOxcnpiHXHhAjJfRFP:matrix.parity.io/$0oidO-aZvsjMRdskB2nig6P_Y4CjH4Gc6TMrl4V7ZB8?via=matrix.parity.io&via=matrix.org&via=matrix.dapp.org.uk After cloning https://github.com/polkadot-js/apps and debugging the error, I found that this change resolved the error and the error no longer appears when I access those apps --- 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 caf42982ab..68f02226f7 100644 --- a/packages/api-derive/src/balances/all.ts +++ b/packages/api-derive/src/balances/all.ts @@ -92,7 +92,7 @@ function queryOld (api: ApiInterfaceRx, accountId: AccountId): Observable { return ( - api.query.vesting.vesting + api.query.vesting?.vesting ? api.queryMulti<[Vec, Option]>([ [api.query.balances.locks, accountId], [api.query.vesting.vesting, accountId]