diff --git a/src/antidote/org/apache/tools/ant/gui/command/SaveAsCmd.java b/src/antidote/org/apache/tools/ant/gui/command/SaveAsCmd.java index c27cc38ee..4059cd16a 100644 --- a/src/antidote/org/apache/tools/ant/gui/command/SaveAsCmd.java +++ b/src/antidote/org/apache/tools/ant/gui/command/SaveAsCmd.java @@ -135,18 +135,19 @@ public class SaveAsCmd extends AbstractCommand { getContext().getParentFrame(), message, title, JOptionPane.YES_NO_OPTION); // If cancelled unset file. - if(val == JOptionPane.YES_OPTION) { - try { - _location = new URL( - "file", null, file.getAbsolutePath()); - } - catch(MalformedURLException ex) { - // Shouldn't happen. Save will just not - // happen. - ex.printStackTrace(); - } + if(val != JOptionPane.YES_OPTION) { + return; } } + try { + _location = new URL( + "file", null, file.getAbsolutePath()); + } + catch(MalformedURLException ex) { + // Shouldn't happen. Save will just not + // happen. + ex.printStackTrace(); + } } } @@ -162,7 +163,7 @@ public class SaveAsCmd extends AbstractCommand { new Object[] { _location.toString() }); getContext().getEventBus(). - postEvent(new ErrorEvent(getContext(), message)); + postEvent(new ErrorEvent(getContext(), message, ex)); } } }