Skip to content

Commit

Permalink
Fix NPE in PDEModelUtility by adding null check (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
slvo-loading authored and HannesWell committed Dec 30, 2024
1 parent 2f6b308 commit 6e21922
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.eclipse.pde.internal.ui.editor.build.BuildInputContext;
import org.eclipse.pde.internal.ui.editor.build.BuildSourcePage;
import org.eclipse.pde.internal.ui.editor.context.InputContext;
import org.eclipse.pde.internal.ui.editor.context.InputContextManager;
import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor;
import org.eclipse.pde.internal.ui.editor.schema.SchemaEditor;
import org.eclipse.pde.internal.ui.editor.schema.SchemaInputContext;
Expand Down Expand Up @@ -412,9 +413,13 @@ private static void modifyEditorModel(final ModelModification mod, final PDEForm
for (IFile file : files) {
if (file == null)
continue;
InputContext con = editor.getContextManager().findContext(file);
if (con != null)
con.flushEditorInput();
InputContextManager manager = editor.getContextManager();
if (manager != null){
InputContext con = manager.findContext(file);
if (con != null) {
con.flushEditorInput();
}
}
}
if (mod.saveOpenEditor())
editor.doSave(monitor);
Expand Down

0 comments on commit 6e21922

Please sign in to comment.