From: Michael Mokry Date: Fri, 26 Apr 2019 14:20:12 +0000 (-0500) Subject: Fix nullpointer issue in pdpx heartbeat X-Git-Tag: 3.0.2-ONAP~2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F86406%2F2;p=policy%2Fxacml-pdp.git 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 --- 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);