Refactor
This commit is contained in:
parent
83e7f189d6
commit
9fe2c81784
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue