Skip to content

Commit

Permalink
FAB-11179 NodeSDK - Handle missing discovery
Browse files Browse the repository at this point in the history
NodeSDK should throw a better error when there are
no endorsement targets.

Change-Id: Id6c26b0ec81cd2d4575bb241ae8c8aeac7d0951a
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
  • Loading branch information
harrisob committed Jul 16, 2018
1 parent d23963e commit 186ace3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fabric-client/lib/impl/DiscoveryEndorsementHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DiscoveryEndorsementHandler extends api.EndorsementHandler {
async _endorse(discovery_plan, request, proposal) {
const method = '_endorse';
// see if we have an endorsement plan for the requested chaincode
if(discovery_plan && discovery_plan.endorsement_targets[request.chaincodeId]) {
if(discovery_plan && discovery_plan.endorsement_targets && discovery_plan.endorsement_targets[request.chaincodeId]) {
logger.debug('%s - found discovery endorsement plan for %s', method, request.chaincodeId);
const chaincode_plan = discovery_plan.endorsement_targets[request.chaincodeId];
chaincode_plan.endorsements = {};
Expand Down

0 comments on commit 186ace3

Please sign in to comment.