From 6847a28b5b59649f974dab36657ba7e82a62be92 Mon Sep 17 00:00:00 2001 From: Sydney Vo Date: Sat, 16 Nov 2024 03:12:37 +0000 Subject: [PATCH] Fix NPE in PDEModelUtility.java (line 415) by adding null check (#1404) --- .../org/eclipse/pde/internal/ui/util/PDEModelUtility.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java index ba458cfb4e..bae7cf2879 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java @@ -412,9 +412,11 @@ 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(); + if (editor.getContextManager() != null){ + InputContext con = editor.getContextManager().findContext(file); + if (con != null) + con.flushEditorInput(); + } } if (mod.saveOpenEditor()) editor.doSave(monitor);