From d2d5675af191d2650cf8c627268d2a9afb114a7b Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Tue, 19 Sep 2017 12:10:28 +0530 Subject: Fix Sonar Issue One blocker issue in sli/adapters module *check for null dereferencing Issue-Id: CCSDK-87 Change-Id: I6c2b308bed95069089770cbec7ef728e2a8cc030 Signed-off-by: surya-huawei --- .../onap/ccsdk/sli/adaptors/rm/dao/jdbc/ResourceDaoImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'resource-assignment/provider/src') diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/ResourceDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/ResourceDaoImpl.java index 9ee3cc18..7db37fff 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/ResourceDaoImpl.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/ResourceDaoImpl.java @@ -298,10 +298,12 @@ public class ResourceDaoImpl implements ResourceDao { r = rr; } - r.resourceType = type; - r.resourceKey = new ResourceKey(); - r.resourceKey.assetId = resourceEntity.assetId; - r.resourceKey.resourceName = resourceEntity.name; + if (r != null) { + r.resourceType = type; + r.resourceKey = new ResourceKey(); + r.resourceKey.assetId = resourceEntity.assetId; + r.resourceKey.resourceName = resourceEntity.name; + } return r; } -- cgit 1.2.3-korg