From 8745dc8b2b1061bd678ed8e7fd6de9a40b304917 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Sat, 10 Apr 2021 20:38:25 -0500 Subject: [PATCH] Account for null chain from database --- src/app/units/Blockchain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/units/Blockchain.ts b/src/app/units/Blockchain.ts index 0a04b90..30b8105 100644 --- a/src/app/units/Blockchain.ts +++ b/src/app/units/Blockchain.ts @@ -190,7 +190,7 @@ export class Blockchain extends Unit { this.logging.debug({peers, chain}) - this.approvedChain = chain.map((item: BlockResourceItem) => new Block(item)) + this.approvedChain = (chain || []).map((item: BlockResourceItem) => new Block(item)) this.peers = peers || [] }