aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap
diff options
context:
space:
mode:
authorElena Kuleshov <evn@att.com>2019-08-01 03:13:04 -0400
committerElena Kuleshov <evn@att.com>2019-08-01 03:14:38 -0400
commitb9163367a8760d5e4249fce287f638f1ec9dddfb (patch)
tree0876318fd0c0e4c959ffc0db6aaff06560b18d80 /common/src/main/java/org/onap
parent15c7bc833ae91ed2590370dd001d5361149aef9a (diff)
Handle no pservers case on lock check
Check for null return value from pservers query Issue-ID: SO-2184 Signed-off-by: Kuleshov, Elena <evn@att.com> Change-Id: I34c71601e694241a6d3cfefa8227200e715e2ed3
Diffstat (limited to 'common/src/main/java/org/onap')
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIValidatorImpl.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIValidatorImpl.java b/common/src/main/java/org/onap/so/client/aai/AAIValidatorImpl.java
index 95ed01ee94..96844ff1cb 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIValidatorImpl.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIValidatorImpl.java
@@ -47,10 +47,12 @@ public class AAIValidatorImpl implements AAIValidator {
List<Pserver> pservers;
boolean isLocked = false;
pservers = client.getPhysicalServerByVnfId(vnfId);
- for (Pserver pserver : pservers) {
- if (pserver.isInMaint()) {
- isLocked = true;
- return isLocked;
+ if (pservers != null) {
+ for (Pserver pserver : pservers) {
+ if (pserver.isInMaint()) {
+ isLocked = true;
+ return isLocked;
+ }
}
}
return isLocked;