Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit a26a58c

Browse files
committed
Fixes SORMAS-Foundation#3348 null value in create Event Actions
1 parent e5bb6ee commit a26a58c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

sormas-ui/src/main/java/de/symeda/sormas/ui/action/ActionEditForm.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import static de.symeda.sormas.ui.utils.LayoutUtil.locs;
2525

2626
import com.vaadin.v7.ui.ComboBox;
27-
import com.vaadin.v7.ui.Field;
2827
import com.vaadin.v7.ui.Label;
2928
import com.vaadin.v7.ui.RichTextArea;
3029
import com.vaadin.v7.ui.TextField;
@@ -162,18 +161,16 @@ private void updateByCreating() {
162161
}
163162

164163
private void updateByActionContext() {
165-
NullableOptionGroup field = (NullableOptionGroup) getFieldGroup().getField(ActionDto.ACTION_CONTEXT);
166-
ActionContext actionContext = (ActionContext) field.getNullableValue();
164+
Object fieldValueActionContext = getFieldGroup().getField(ActionDto.ACTION_CONTEXT).getValue();
165+
ActionContext actionContext = fieldValueActionContext == null ? null : (ActionContext) fieldValueActionContext;
167166

168167
// context reference depending on action context
169168
// ready for adding new context
170169
ComboBox eventField = (ComboBox) getFieldGroup().getField(ActionDto.EVENT);
171170
if (actionContext != null) {
172-
switch (actionContext) {
173-
case EVENT:
171+
if (actionContext == ActionContext.EVENT) {
174172
FieldHelper.setFirstVisibleClearOthers(eventField);
175173
FieldHelper.setFirstRequired(eventField);
176-
break;
177174
}
178175
} else {
179176
FieldHelper.setFirstVisibleClearOthers(null, eventField);

0 commit comments

Comments
 (0)