From fcef52d26322c485606b11ef95e59ddd7d4ddcf0 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);