diff options
author | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-08-07 13:47:54 -0400 |
---|---|---|
committer | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-08-07 15:11:15 -0400 |
commit | 8155c85c8d342e68256e5b4da804f822a26a370a (patch) | |
tree | 274007d52b77ab425ca2ac0bcc18333639fea1c6 /bpmn/MSOCommonBPMN/src/main/java/org | |
parent | e468693695de298bf2282508fa00c3a21496524e (diff) |
Add SO Message instead of Exception when vmIds are empty
Add the conditions to log messages instead of null pointer exception
when vmIds or vserverIds are not present.
Issue-ID: SO-2186
Signed-off-by: Bonkur, Venkat (vb8416) <vb8416@att.com>
Change-Id: I27dd8a5480cf5e2d8588cc71ca3bfefaf0e138cc
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerAction.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerAction.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerAction.java index 9828d11186..c05557a317 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerAction.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerAction.java @@ -78,8 +78,24 @@ public class ApplicationControllerAction { appCStatus = healthCheckAction(msoRequestId, vnfId, vnfName, vnfHostIpAddress, controllerType); break; case Snapshot: + if (vmIdList.isEmpty()) { + logger.warn("vmIdList is Empty in AppCClient"); + break; + } String vmIds = JsonUtils.getJsonValue(vmIdList, "vmIds"); + if (vmIds == null) { + logger.warn("vmIds null in AppCClient"); + break; + } + if (vserverIdList.isEmpty()) { + logger.warn("vserverIdList is empty in AppCClient"); + break; + } String vserverIds = JsonUtils.getJsonValue(vserverIdList, "vserverIds"); + if (vserverIds == null) { + logger.warn("vserverIds null in AppCClient"); + break; + } String vmId = ""; String vserverId = ""; ObjectMapper mapper = new ObjectMapper(); |