Project

General

Profile

« Previous | Next » 

Revision 1290db5c

Added by Katja Luther almost 7 years ago

avoid NPE in check for dirty editors

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractImportWizard.java
78 78
		if(activePage != null){
79 79
			for (IEditorReference reference : activePage.getEditorReferences()) {
80 80
				IEditorPart editor = reference.getEditor(false);
81
				if(editor.isDirty()){
82
					return true;
81
				if (editor!= null){
82
					if(editor.isDirty()){
83
						return true;
84
					}
83 85
				}
84 86
			}
85 87
		}
......
88 90

  
89 91
	@Override
90 92
	public boolean canFinish() {
91
	    return !existUnsavedEditors() && super.canFinish();
93
		return !existUnsavedEditors() && super.canFinish();
92 94
	}
93 95

  
94 96
	public abstract CONFIG getConfigurator();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
185 185
        final String methodName = method.getName();
186 186
        final Button checkBox = new Button(parent, SWT.CHECK);
187 187

  
188
        if(configurator.getClass().equals(Abcd206ImportConfigurator.class)){
188
       // if(configurator.getClass().equals(Abcd206ImportConfigurator.class)){
189 189
            String[] r = methodName.split("set")[1].split("(?=\\p{Upper})");
190 190
            checkBox.setText(getLabel(StringUtils.join(r," ")));
191
        }
192
        else{
193
            checkBox.setText(getLabel(methodName));
194
        }
191
//        }
192
//        else{
193
//            checkBox.setText(getLabel(methodName));
194
//        }
195 195
        // retrieve the default values and set the checkbox accordingly
196 196
        boolean defaultSelection = executeBooleanGetMethod(configurator, "is"
197 197
                + methodName.substring(3));

Also available in: Unified diff