diff options
author | Pawel Piech | 2012-11-09 22:06:28 +0000 |
---|---|---|
committer | Pawel Piech | 2012-11-09 22:06:28 +0000 |
commit | 0fdc06169e049797177f39ca4861680051f2eff2 (patch) | |
tree | 6ac4ed3306ff7b1c6ceea05e7da9790729afcb44 | |
parent | 7770d99165b3fd0c6e8a08e22c411f9b07362a53 (diff) | |
download | eclipse.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
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); } |