Fixed null pointer exception for JSON RA 49/117949/1
authorLukasz Rajewski <lukasz.rajewski@orange.com>
Wed, 17 Feb 2021 13:11:06 +0000 (14:11 +0100)
committerLukasz Rajewski <lukasz.rajewski@orange.com>
Wed, 17 Feb 2021 13:15:18 +0000 (14:15 +0100)
Fixed null pointer exception for JSON RA

Issue-ID: CCSDK-3170
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I721ff7966a1c1bd99ab948cdc410f05688ddea23

ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt

index 3440e38..5a03450 100644 (file)
@@ -685,7 +685,9 @@ class ResourceAssignmentUtils {
             raRuntimeService: ResourceAssignmentRuntimeService
         ): Boolean {
             val dataTypeProps = raRuntimeService.bluePrintContext().dataTypeByName(dataTypeName)?.properties
-            val result = outputKeyMapping.filterKeys { !dataTypeProps!!.containsKey(it) }.keys.firstOrNull()
+            var result: String? = null
+            if (dataTypeProps != null)
+                result = outputKeyMapping.filterKeys { !dataTypeProps.containsKey(it) }.keys.firstOrNull()
             return result == null
         }