Skip to content

Commit 6e21922

Browse files
slvo-loadingHannesWell
authored andcommitted
Fix NPE in PDEModelUtility by adding null check (#1404)
1 parent 2f6b308 commit 6e21922

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import org.eclipse.pde.internal.ui.editor.build.BuildInputContext;
5555
import org.eclipse.pde.internal.ui.editor.build.BuildSourcePage;
5656
import org.eclipse.pde.internal.ui.editor.context.InputContext;
57+
import org.eclipse.pde.internal.ui.editor.context.InputContextManager;
5758
import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor;
5859
import org.eclipse.pde.internal.ui.editor.schema.SchemaEditor;
5960
import org.eclipse.pde.internal.ui.editor.schema.SchemaInputContext;
@@ -412,9 +413,13 @@ private static void modifyEditorModel(final ModelModification mod, final PDEForm
412413
for (IFile file : files) {
413414
if (file == null)
414415
continue;
415-
InputContext con = editor.getContextManager().findContext(file);
416-
if (con != null)
417-
con.flushEditorInput();
416+
InputContextManager manager = editor.getContextManager();
417+
if (manager != null){
418+
InputContext con = manager.findContext(file);
419+
if (con != null) {
420+
con.flushEditorInput();
421+
}
422+
}
418423
}
419424
if (mod.saveOpenEditor())
420425
editor.doSave(monitor);

0 commit comments

Comments
 (0)