This commit is contained in:
Reinhard Pointner 2016-03-09 06:17:25 +00:00
parent 83e7f189d6
commit 9fe2c81784
1 changed files with 3 additions and 2 deletions

View File

@ -526,7 +526,7 @@ public class FormatDialog extends JDialog {
@Override @Override
protected void done() { protected void done() {
try { try {
preview.setText(get()); String value = get().trim();
// check internal script exception // check internal script exception
if (format.caughtScriptException() != null) { if (format.caughtScriptException() != null) {
@ -534,11 +534,12 @@ public class FormatDialog extends JDialog {
} }
// check empty output // check empty output
if (get().trim().isEmpty()) { if (value.isEmpty()) {
throw new Exception("Formatted value is empty"); throw new Exception("Formatted value is empty");
} }
// no warning or error // no warning or error
preview.setText(value);
status.setVisible(false); status.setVisible(false);
} catch (CancellationException e) { } catch (CancellationException e) {
// ignore, cancelled tasks are obsolete anyway // ignore, cancelled tasks are obsolete anyway