Fix for VID-928: NullPointerException during deploy service instance with empty cds...
[vid.git] / vid-app-common / src / main / java / org / onap / vid / job / command / MsoRequestBuilder.kt
index b69f76d..6146fec 100644 (file)
@@ -250,9 +250,10 @@ class MsoRequestBuilder
                 }
         }
 
-        val result: MutableMap<String, String> = instanceParams[0].entries.stream()
+        val result: MutableMap<String, String> = mutableMapOf();
+        instanceParams[0].entries.stream()
                 .filter { entry -> !keysToRemove.contains(entry.key) }
-                .collect(Collectors.toMap({ it.key }, { it.value }))
+                .forEach { t -> result.put(t.key, t.value) }
 
         return if (result.isEmpty()) emptyList() else listOf(result)
     }