Fix nullpointer issue in pdpx heartbeat 06/86406/2
authorMichael Mokry <michael.mokry@att.com>
Fri, 26 Apr 2019 14:20:12 +0000 (09:20 -0500)
committerMichael Mokry <michael.mokry@att.com>
Fri, 26 Apr 2019 14:30:19 +0000 (09:30 -0500)
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>
main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpMessage.java

index 802d735..066e3f2 100644 (file)
@@ -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);