Project

General

Profile

« Previous | Next » 

Revision e116bd58

Added by Katja Luther over 4 years ago

fix NPE in StoreUtil

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
240 240
                prefValue = getPreferenceStore().
241 241
                        getString(name);
242 242
            }
243
            if (StringUtils.isBlank(prefValue)){
243
            if (StringUtils.isBlank(prefValue) || (pref == null && !override)){
244 244
                IPreferencePredicate pred = PreferencePredicate.getByKey(name);
245 245
                if (pred != null){
246 246
                    if (pred.getDefaultValue() instanceof String){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/StoreUtil.java
226 226
        int style = ExpandableComposite.TWISTIE;
227 227
        String prefKey = getPrefKey(clazz, input);
228 228
        if(PreferencesUtil.contains(prefKey)){
229
            style = PreferencesUtil.getStringValue(prefKey).equals(CdmSectionPart.EXPANDED)?style |= ExpandableComposite.EXPANDED:style;
229
            String string = PreferencesUtil.getStringValue(prefKey);
230
            if (string != null){
231
                style = string.equals(CdmSectionPart.EXPANDED)?style |= ExpandableComposite.EXPANDED:style;
232
            }else{
233
                style = initiallyExpanded?style |= ExpandableComposite.EXPANDED:style;
234
            }
230 235
        }
231 236
        else{
232 237
            style = initiallyExpanded?style |= ExpandableComposite.EXPANDED:style;

Also available in: Unified diff