mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Fixed bug introduced by #2628
This commit is contained in:
parent
00941453db
commit
5687528325
@ -967,13 +967,17 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
}
|
||||
JCheckBoxMenuItem selection = null;
|
||||
for (int i = 0; i < serialMenu.getItemCount(); i++) {
|
||||
JCheckBoxMenuItem item = ((JCheckBoxMenuItem)serialMenu.getItem(i));
|
||||
if (item == null) {
|
||||
JMenuItem menuItem = serialMenu.getItem(i);
|
||||
if (!(menuItem instanceof JCheckBoxMenuItem)) {
|
||||
continue;
|
||||
}
|
||||
JCheckBoxMenuItem checkBoxMenuItem = ((JCheckBoxMenuItem) menuItem);
|
||||
if (checkBoxMenuItem == null) {
|
||||
System.out.println(_("name is null"));
|
||||
continue;
|
||||
}
|
||||
item.setState(false);
|
||||
if (name.equals(item.getText())) selection = item;
|
||||
checkBoxMenuItem.setState(false);
|
||||
if (name.equals(checkBoxMenuItem.getText())) selection = checkBoxMenuItem;
|
||||
}
|
||||
if (selection != null) selection.setState(true);
|
||||
//System.out.println(item.getLabel());
|
||||
|
Loading…
x
Reference in New Issue
Block a user