Bug 476928 - NullPointerException in DebugActionHandler.getDelegate
(DebugActionHandler.java:48)
Change-Id: I6d7b2192d0f94f98349282773c51d3723758d81c
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
index 0d43165..1a3591e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,7 +44,7 @@
*/
protected IHandler2 getDelegate() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
+ if (window != null && window.getActivePage() != null) {
IViewReference reference = window.getActivePage().findViewReference(IDebugUIConstants.ID_DEBUG_VIEW);
if (reference != null) {
IViewPart view = reference.getView(false);