aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mokry <michael.mokry@att.com>2019-04-26 09:20:12 -0500
committerMichael Mokry <michael.mokry@att.com>2019-04-26 09:30:19 -0500
commit6632b5f4a6b3949db71228c84881c4e8badb1b64 (patch)
tree598c7ac4baac8b5bfc052cfc2886d48ad15aab29
parent74ced993d23d84cc12af2978d8c9c3916a6a518b (diff)
Fix nullpointer issue in pdpx heartbeat
1. Added a null check against XacmlPdpActivator.getCurrent() method to fix the following exception Exception in thread "Timer-0" java.lang.NullPointerException Change-Id: Ia6c7efc2bd317dd52e9e89dd4f9f59d9d66d0857 Issue-ID: POLICY-1703 Signed-off-by: Michael Mokry <michael.mokry@att.com>
-rw-r--r--main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpMessage.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpMessage.java b/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpMessage.java
index 802d735a..066e3f23 100644
--- a/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpMessage.java
+++ b/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpMessage.java
@@ -79,7 +79,7 @@ public class XacmlPdpMessage {
PdpStatus status = new PdpStatus();
status.setName(pdpName);
- if (XacmlPdpActivator.getCurrent().isAlive()) {
+ if (XacmlPdpActivator.getCurrent() != null && XacmlPdpActivator.getCurrent().isAlive()) {
status.setHealthy(PdpHealthStatus.HEALTHY);
} else {
status.setHealthy(PdpHealthStatus.NOT_HEALTHY);