ref #5969: check for db connection before ty to read the preferred nomenclatural...
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / NomenclaturalCodePreferences.java
index b52eee0aa9394a5a2e01e156e2cb2efab1431883..d5000b34e172d8078c8e9649ddad43b4da807416 100644 (file)
@@ -94,6 +94,9 @@ public class NomenclaturalCodePreferences extends FieldEditorPreferencePage
                        String value = getPreferenceStore().getString(IPreferenceKeys.PREFERRED_NOMENCLATURAL_CODE_KEY);
                        CdmPreference pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NomenclaturalCode, value);
                        ICdmApplicationConfiguration controller = CdmStore.getCurrentApplicationConfiguration();
+                       if (controller == null){
+                               return false;
+                       }
                        IPreferenceService service = controller.getPreferenceService();
                        service.set(pref);
                }