Skip to main content
diff options
authorSimeon Andreev2018-06-01 09:55:46 -0400
committerSimeon Andreev2018-06-01 10:27:12 -0400
commite6af2c77b1a2e9ebdad8c1036600a84618de2c6f (patch)
parent45add9a8becea83d0bf35fd5990cb4b6fdb7f348 (diff)
Bug 535454 - do not allow null context in DebugContextEvent constructor
In case of a null context passed to the constructor of DebugContextEvent, a NPE could be thrown later on when the event is being processed. This is the case since DebugContextEvent.getContext() makes no mention of possibly returning a null. E.g. some code in ToggleStepFiltersAction and LaunchView does not check if the returned context is null. At the point of throwing the NPE, its unclear where the null context actually came from. For issues which are difficult to reproduce, this information is vital. With this change, an exception is thrown if the passed context is null. Change-Id: If7a86500bc827bc6aa73ca971c9be79a714be81f Signed-off-by: Simeon Andreev <>
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/
index a8e116f05..47668a56a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/
@@ -12,6 +12,7 @@ package org.eclipse.debug.ui.contexts;
import java.util.EventObject;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ISelection;
@@ -64,6 +65,7 @@ public class DebugContextEvent extends EventObject {
public DebugContextEvent(IDebugContextProvider source, ISelection context, int flags) {
+ Assert.isNotNull(context, "DebugContextEvent context must not be null"); //$NON-NLS-1$
fContext = context;
fFlags = flags;

Back to the top