From 508558d11b4a10edf29d2273fb75ae39438f01f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Kubitz?= Date: Wed, 22 Nov 2023 12:42:42 +0100 Subject: [PATCH] EnableBreakpointsAction.asynchUpdate: fix NPE #874 https://github.com/eclipse-platform/eclipse.platform/issues/874 --- .../ui/actions/breakpoints/EnableBreakpointsAction.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java index b3d9094eaf7..d1ed65ddeed 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java @@ -37,6 +37,7 @@ import org.eclipse.ui.IPartListener; import org.eclipse.ui.IViewActionDelegate; import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; @@ -243,7 +244,11 @@ protected void asynchUpdate() { return; } Runnable r = () -> { - IWorkbenchWindow ww = getView().getViewSite().getPage().getWorkbenchWindow(); + IWorkbenchPage page = getView().getViewSite().getPage(); + if (page == null) { + return; + } + IWorkbenchWindow ww = page.getWorkbenchWindow(); if (ww == null) { return; }