From 1b9d5e1e569a8454132d268c3e9f1597bd5a20fc Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Tue, 13 Nov 2012 11:56:26 +0100 Subject: Guard against empty error messages --- .../at/asit/pdfover/gui/composites/ConfigurationComposite.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java index 6e1ae0e0..f9ff5b7f 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java @@ -382,7 +382,10 @@ public class ConfigurationComposite extends StateComposite { } while (redo); } catch (Exception e) { log.error("Settings validation failed!", e); //$NON-NLS-1$ - ErrorDialog dialog = new ErrorDialog(getShell(), e.getMessage(), + String message = e.getMessage(); + if (message == null) + message = Messages.getString("error.Unexpected"); //$NON-NLS-1$ + ErrorDialog dialog = new ErrorDialog(getShell(), message, BUTTONS.OK); dialog.open(); return false; @@ -435,8 +438,7 @@ public class ConfigurationComposite extends StateComposite { status = true; } catch (IOException e) { log.error("Failed to save configuration to file!", e); //$NON-NLS-1$ - ErrorDialog dialog = new ErrorDialog( - getShell(), + ErrorDialog dialog = new ErrorDialog(getShell(), Messages.getString("error.FailedToSaveSettings"), BUTTONS.RETRY_CANCEL); //$NON-NLS-1$ redo = (dialog.open() == SWT.RETRY); -- cgit v1.2.3