From 51073339a0c94a0ad3d1f0f8837d8bbba02ad77c Mon Sep 17 00:00:00 2001 From: metasim Date: Thu, 11 Jan 2001 19:22:24 +0000 Subject: [PATCH] Fixed bug where location wasn't getting set. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268437 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/gui/command/SaveAsCmd.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) 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)); } } }