From 25f6eafc1aff56b3cb98f00c8dbc7ac4ba9f32df Mon Sep 17 00:00:00 2001 From: xiejunan Date: Wed, 31 Aug 2016 14:42:27 +0000 Subject: [PATCH] a dev chaincode must provide chaincode id output error when chaincodename=="" Change-Id: I12661bf5001981af139a75cef0445f9be327213c Signed-off-by: xiejunan --- core/chaincode/shim/chaincode.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/chaincode/shim/chaincode.go b/core/chaincode/shim/chaincode.go index b6b0d4e5607..11c10eda8a9 100644 --- a/core/chaincode/shim/chaincode.go +++ b/core/chaincode/shim/chaincode.go @@ -97,6 +97,9 @@ func Start(cc Chaincode) error { } chaincodename := viper.GetString("chaincode.id.name") + if chaincodename == "" { + return fmt.Errorf("Error chaincode id not provided") + } err = chatWithPeer(chaincodename, stream, cc) return err