diff --git a/fabric-client/lib/impl/DiscoveryEndorsementHandler.js b/fabric-client/lib/impl/DiscoveryEndorsementHandler.js index 0f0da6c9d9..0196e47681 100644 --- a/fabric-client/lib/impl/DiscoveryEndorsementHandler.js +++ b/fabric-client/lib/impl/DiscoveryEndorsementHandler.js @@ -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 = {};