Account for null chain from database

This commit is contained in:
Garrett Mills 2021-04-10 20:38:25 -05:00
parent b68c961046
commit 8745dc8b2b
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -190,7 +190,7 @@ export class Blockchain extends Unit {
this.logging.debug({peers, chain}) 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 || [] this.peers = peers || []
} }