Skip to content

Commit

Permalink
correct small error
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Mar 14, 2024
1 parent 8b7f5dc commit 2f23921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/ai/nets/samj/gui/SAMJDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
for (int i = 0; i < objects.length; i ++) objects[i] = openSeqs.get(i);
DefaultComboBoxModel<ComboBoxItem> comboBoxModel = new DefaultComboBoxModel<ComboBoxItem>(objects);
this.cmbImage.setModel(comboBoxModel);
if (item != null)
if (item != null && objects.length != 0)
this.cmbImage.setSelectedIndex(
IntStream.range(0, objects.length).filter(i -> objects[i].getId() == ((ComboBoxItem) item).getId()).findFirst().orElse(0)
);
Expand Down

0 comments on commit 2f23921

Please sign in to comment.