Selaa lähdekoodia

the methods' parameter may be null for setValue and setOptionalValues

sunyj 8 vuotta sitten
vanhempi
commit
74c2659a6f

+ 2 - 2
kanban-console/src/main/java/com/uas/kanban/model/Parameter.java

@@ -169,8 +169,8 @@ public class Parameter extends BaseEntity {
             tempOptionalValues = optionalValues;
             return;
         }
+        this.optionalValues = new ArrayList<>();
         if (optionalValues != null) {
-            this.optionalValues = new ArrayList<>();
             for (Object object : optionalValues) {
                 Value v = new Value();
                 v.setValue(type, object);
@@ -193,7 +193,7 @@ public class Parameter extends BaseEntity {
             tempValue = value;
             return;
         }
-        if (this.value == null) {
+        if (value == null || this.value == null) {
             this.value = new Value();
         }
         this.value.setValue(type, value);