From b24c44159cdfc5fb3417890d84f6074a6cd02f78 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Tue, 20 Feb 2018 11:03:39 +0530 Subject: Improve logging and avoid null chance Issue-ID: CLI-92 Change-Id: I681f605a1cb52ff548c03b5510452cafb648bae9 Signed-off-by: Kanagaraj Manickam k00365106 --- .../snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles') diff --git a/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java b/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java index cf2d91d0..6bdc9a03 100644 --- a/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java +++ b/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java @@ -120,7 +120,7 @@ public class OnapSnmpCommand extends OnapCommand { case OnapCommandSnmpConstants.SNMP_CMD_GET: ResponseEvent responseEvent = snmp.send(getPDU(PDU.GET, oidStrArr), getTarget(), null); - if ( responseEvent != null || responseEvent.getResponse().getErrorStatus() == PDU.noError) { + if ( responseEvent != null && responseEvent.getResponse().getErrorStatus() == PDU.noError) { Vector variableBindings = responseEvent.getResponse().getVariableBindings(); variableBindings.stream().forEach(varBinding -> { //NOSONAR String key = getKeyForValue(varBinding.getOid().toString()); -- cgit 1.2.3-korg