Skip to content

Commit e997f7d

Browse files
author
Jason Yellick
committed
[FAB-7399] Check for nil resources config
If the experimental resources tree support is enabled, but the genesis block does not contain a seed resources tree, then an error is thrown because the config is nil. This CR simply checks for the nil case, and if so, uses an empty resources tree as the seed. Change-Id: I7c031d5c450cf9601175fc04a7d2c5355f051b7a Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
1 parent 5db5b21 commit e997f7d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/peer/peer.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,17 @@ func createChain(cid string, ledger ledger.PeerLedger, cb *common.Block) error {
337337

338338
resConf := &common.Config{ChannelGroup: &common.ConfigGroup{}}
339339
if ac != nil && ac.Capabilities().ResourcesTree() {
340-
if resConf, err = retrievePersistedResourceConfig(ledger); err != nil {
340+
iResConf, err := retrievePersistedResourceConfig(ledger)
341+
342+
if err != nil {
341343
return err
342344
}
345+
346+
if iResConf != nil {
347+
resConf = iResConf
348+
}
343349
}
350+
344351
rBundle, err := resourcesconfig.NewBundle(cid, resConf, bundle)
345352

346353
cs.bundleSource = resourcesconfig.NewBundleSource(

0 commit comments

Comments
 (0)