1
0
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:
Shigeru KANEMOTO 2013-02-13 01:01:59 +09:00 committed by Federico Fissore
parent 2fde40f46a
commit f183579eaa

View File

@ -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();
}