Skip to content

Commit 677b97c

Browse files
committed
Improved dropdown option not selected logic
1 parent 7b5023f commit 677b97c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/com/magento/idea/magento2plugin/actions/generation/dialog/AbstractDialog.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ private String resolveFieldValueByComponentType(final Object field) {
184184
if (field instanceof JTextField) {
185185
return ((JTextField) field).isEditable() ? ((JTextField) field).getText() : null;
186186
} else if (field instanceof JComboBox) {
187-
try {
188-
return ((JComboBox) field).getSelectedItem().toString();
189-
} catch (NullPointerException exception) {
187+
if (((JComboBox<?>) field).getSelectedIndex() == -1) {
190188
return "";
189+
} else {
190+
return ((JComboBox) field).getSelectedItem().toString();
191191
}
192192
}
193193
return null;

0 commit comments

Comments
 (0)