ref #8385: fix NPE
authorKatja Luther <k.luther@bgbm.org>
Thu, 29 Aug 2019 10:50:10 +0000 (12:50 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 29 Aug 2019 10:50:10 +0000 (12:50 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java

index 813ea328ed511ed4179bd197acdf4c1421482d9b..cd9d2f28c2ca5bc903a1f4cd9f74ce47e4895640 100644 (file)
@@ -95,7 +95,7 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
         getValues();\r
         Composite composite = new Composite(parent, SWT.NULL);\r
         composite.setLayout(new GridLayout());\r
-        if (!isAdminPreference && distributionEditorPref != null && !distributionEditorPref.isAllowOverride()&& !isEditorActivated ) {\r
+        if (!isAdminPreference && distributionEditorPref != null && !distributionEditorPref.isAllowOverride()&& isEditorActivated != null && !isEditorActivated ) {\r
             Label label = new Label(composite, SWT.NONE);\r
             label.setText(\r
                     "The CDM settings don't allow to set the preferences for using the distribution editor locally. If you need to make local settings, please ask an administrator.");\r
@@ -153,7 +153,7 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
                 if (isEditorActivated != null){\r
                     child.setEnabled(isEditorActivated);\r
                 }else{\r
-                    child.setEnabled(Boolean.parseBoolean(distributionEditorPref.getValue().toString()));\r
+                    child.setEnabled(distributionEditorPref.getValue() != null?Boolean.parseBoolean(distributionEditorPref.getValue().toString()): true);\r
                 }\r
             }\r
             separator = new Label(child, SWT.HORIZONTAL | SWT.SEPARATOR);\r
@@ -518,6 +518,7 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
             String text = activateCombo.getText();\r
             if(text.startsWith(Messages.Preference_Use_Default)){\r
                 isEditorActivated = null;\r
+\r
                 return;\r
             }\r
 \r