mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
Fix: Exception if type ESC for close confirmation.
If you type an Escape key if a close econfirmation dialog is prompted for unsaved file, an exception thrown. This behavior fixed.
This commit is contained in:
parent
2fde40f46a
commit
f183579eaa
@ -2043,16 +2043,15 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
JOptionPane.YES_NO_CANCEL_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE);
|
||||
|
||||
if (result == JOptionPane.YES_OPTION) {
|
||||
switch (result) {
|
||||
case JOptionPane.YES_OPTION:
|
||||
return handleSave(true);
|
||||
|
||||
} else if (result == JOptionPane.NO_OPTION) {
|
||||
case JOptionPane.NO_OPTION:
|
||||
return true; // ok to continue
|
||||
|
||||
} else if (result == JOptionPane.CANCEL_OPTION) {
|
||||
return false;
|
||||
|
||||
} else {
|
||||
case JOptionPane.CANCEL_OPTION:
|
||||
case JOptionPane.CLOSED_OPTION: // Escape key pressed
|
||||
return false;
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user