Added more protection around getDesktop calls. First test

Desktop.isDesktopSupported() and fail fast.
This commit is contained in:
kruland2607 2013-09-16 10:04:19 -05:00
parent ee38ef2d3d
commit 4421b0ef85
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ public class EditDecalDialog extends JDialog {
ButtonGroup execGroup = new ButtonGroup(); ButtonGroup execGroup = new ButtonGroup();
if (Desktop.getDesktop().isSupported(Desktop.Action.EDIT)) { if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.EDIT)) {
systemRadio = new JRadioButton(trans.get("EditDecalDialog.lbl.system")); systemRadio = new JRadioButton(trans.get("EditDecalDialog.lbl.system"));
systemRadio.setSelected(true); systemRadio.setSelected(true);

View File

@ -490,7 +490,7 @@ public class PreferencesDialog extends JDialog {
panel.add(showPrompt, "wrap"); panel.add(showPrompt, "wrap");
execGroup.add(showPrompt); execGroup.add(showPrompt);
if (Desktop.getDesktop().isSupported(Desktop.Action.EDIT)) { if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.EDIT)) {
JRadioButton systemRadio = new JRadioButton(trans.get("EditDecalDialog.lbl.system")); JRadioButton systemRadio = new JRadioButton(trans.get("EditDecalDialog.lbl.system"));
systemRadio.setSelected(preferences.isDecalEditorPreferenceSystem()); systemRadio.setSelected(preferences.isDecalEditorPreferenceSystem());