summaryrefslogtreecommitdiffstats
path: root/resource-assignment/provider/src/main/java/org
diff options
context:
space:
mode:
authorsurya-huawei <a.u.surya@huawei.com>2017-09-19 12:10:28 +0530
committersurya-huawei <a.u.surya@huawei.com>2017-09-19 12:13:49 +0530
commitd2d5675af191d2650cf8c627268d2a9afb114a7b (patch)
treec9c2c6e65fe4114283f02344de3c8d3656a91a23 /resource-assignment/provider/src/main/java/org
parent43c6f425177393be30c3f065522c9ad9bc340639 (diff)
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 <a.u.surya@huawei.com>
Diffstat (limited to 'resource-assignment/provider/src/main/java/org')
-rw-r--r--resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/ResourceDaoImpl.java10
1 files changed, 6 insertions, 4 deletions
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 9ee3cc188..7db37fff5 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;
}