Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-11-09 22:06:28 +0000
committerPawel Piech2012-11-09 22:06:28 +0000
commit0fdc06169e049797177f39ca4861680051f2eff2 (patch)
tree6ac4ed3306ff7b1c6ceea05e7da9790729afcb44
parent7770d99165b3fd0c6e8a08e22c411f9b07362a53 (diff)
downloadeclipse.platform.debug-0fdc06169e049797177f39ca4861680051f2eff2.tar.gz
eclipse.platform.debug-0fdc06169e049797177f39ca4861680051f2eff2.tar.xz
eclipse.platform.debug-0fdc06169e049797177f39ca4861680051f2eff2.zip
Bug 392855 - DebugContextSourceProvider should check for Null beforev20121109-220628I20121113-0800
subscribing fEvaluationService.addSourceProvider
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java3
2 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
index 7b700fea1..d00108be8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
@@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWindowListener;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.services.IEvaluationService;
/**
* @since 3.2
@@ -133,11 +134,12 @@ public class DebugContextManager implements IDebugContextManager {
protected IDebugContextService createService(IWorkbenchWindow window) {
DebugWindowContextService service = (DebugWindowContextService) fServices.get(window);
if (service == null) {
- if (window.getShell() == null) {
+ IEvaluationService evaluationService = (IEvaluationService)window.getService(IEvaluationService.class);
+ if (window.getShell() == null || evaluationService == null) {
// the window has been closed - return a dummy service
return NULL_SERVICE;
} else {
- service = new DebugWindowContextService(window);
+ service = new DebugWindowContextService(window, evaluationService);
fServices.put(window, service);
// register global listeners
Object[] listeners = fGlobalListeners.getListeners();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index 4728bd245..9853bf4ab 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -55,11 +55,10 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
private DebugContextSourceProvider fSourceProvider;
- public DebugWindowContextService(IWorkbenchWindow window) {
+ public DebugWindowContextService(IWorkbenchWindow window, IEvaluationService evaluationService) {
fWindow = window;
fWindow.getPartService().addPartListener(this);
- IEvaluationService evaluationService = (IEvaluationService)window.getService(IEvaluationService.class);
fSourceProvider = new DebugContextSourceProvider(this, evaluationService);
}

Back to the top