From 62f2a214f33b7dd2f04755183df2fc024b5d2ffc Mon Sep 17 00:00:00 2001 From: inoshperera Date: Tue, 7 May 2019 17:40:17 +0530 Subject: [PATCH] fix NPE for policy --- .../point/simple/PolicyEvaluationServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java index 6bc2113e81..70eff77618 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java @@ -43,9 +43,11 @@ public class PolicyEvaluationServiceImpl implements PolicyEvaluationPoint { @Override public List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { - - List effectiveFeatures = evaluation.getEffectivePolicy(deviceIdentifier). - getProfile().getProfileFeaturesList(); + List effectiveFeatures = null; + Policy effectivePolicy = evaluation.getEffectivePolicy(deviceIdentifier); + if (effectivePolicy != null) { + effectiveFeatures = effectivePolicy.getProfile().getProfileFeaturesList(); + } return effectiveFeatures; }