[Policy-20] getConfig & Policy resolved blockers
[policy/engine.git] / ECOMP-PAP-REST / src / main / java / org / openecomp / policy / pap / xacml / rest / controller / MicroServiceDictionaryController.java
index 8d253d3..ecf8462 100644 (file)
@@ -1010,17 +1010,17 @@ public class MicroServiceDictionaryController {
                        this.newModel.setDependency("");
                }
 
-               if (mainClass.getDependency()==null){
+               if (mainClass != null && mainClass.getDependency()==null){
                        mainClass.setDependency("");
                }
-
-               this.newModel.setDependency(mainClass.getDependency());
-               this.newModel.setSub_attributes(subAttribute.toString());
-               this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", ""));
-               this.newModel.setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""));
-        this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", ""));
-        this.newModel.setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", ""));
-
+               if(mainClass != null){
+                       this.newModel.setDependency(mainClass.getDependency());
+                       this.newModel.setSub_attributes(subAttribute);
+                       this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", ""));
+                       this.newModel.setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""));
+                       this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", ""));
+                       this.newModel.setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", ""));
+               }
        } 
        
        private ArrayList<String> getFullDependencyList(ArrayList<String> dependency) {