fix NPE in StoreUtil
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / store / StoreUtil.java
index dec333f61b7072bf2cf09dc1d45a364dc181c0cf..669c7ca2366a44c1d0da1d0b17cebd3a9840207c 100644 (file)
@@ -226,7 +226,12 @@ public class StoreUtil extends AbstractUtility {
         int style = ExpandableComposite.TWISTIE;
         String prefKey = getPrefKey(clazz, input);
         if(PreferencesUtil.contains(prefKey)){
-            style = PreferencesUtil.getStringValue(prefKey).equals(CdmSectionPart.EXPANDED)?style |= ExpandableComposite.EXPANDED:style;
+            String string = PreferencesUtil.getStringValue(prefKey);
+            if (string != null){
+                style = string.equals(CdmSectionPart.EXPANDED)?style |= ExpandableComposite.EXPANDED:style;
+            }else{
+                style = initiallyExpanded?style |= ExpandableComposite.EXPANDED:style;
+            }
         }
         else{
             style = initiallyExpanded?style |= ExpandableComposite.EXPANDED:style;