Merge "Model enhancement to support embedded JSON"
[policy/engine.git] / ONAP-PAP-REST / src / main / java / org / onap / policy / pap / xacml / rest / components / CreateNewMicroServiceModel.java
index f7f8a33..86455aa 100644 (file)
@@ -2,7 +2,8 @@
  * ============LICENSE_START=======================================================
  * ONAP-PAP-REST
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modified Copyright (C) 2018 Samsung Electronics Co., Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -332,7 +333,7 @@ public class CreateNewMicroServiceModel {
         Map<String, String> successMap = new HashMap<>();
         CommonClassDaoImpl dbConnection = new CommonClassDaoImpl();
         List<Object> result = dbConnection.getDataById(MicroServiceModels.class, "modelName:version", modelName+":"+version);
-        if(result.isEmpty()){
+        if(result == null || result.isEmpty()){
             MicroServiceModels model = new MicroServiceModels();
             model.setModelName(modelName);
             model.setVersion(version);