diff options
author | Eugene Tarassov | 2014-10-29 18:45:11 +0000 |
---|---|---|
committer | Eugene Tarassov | 2014-10-29 18:45:11 +0000 |
commit | 3d30d59683766ef734796030b63574de8d8f81ab (patch) | |
tree | 6b088cae84acaff7c838be6c9e1027c521666709 | |
parent | 62c7929af0b09ff3a595b1f278ca8b2f27316e37 (diff) | |
download | org.eclipse.tcf-3d30d59683766ef734796030b63574de8d8f81ab.tar.gz org.eclipse.tcf-3d30d59683766ef734796030b63574de8d8f81ab.tar.xz org.eclipse.tcf-3d30d59683766ef734796030b63574de8d8f81ab.zip |
TCF Debugger: fixed possible NPE during Eclipse shutdown
-rw-r--r-- | plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java index a46003cb5..6370af6fc 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java @@ -70,6 +70,7 @@ import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWindowListener; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; @@ -504,17 +505,20 @@ public class TCFAnnotationManager { WorkbenchWindowInfo win_info = windows.get(window); if (win_info == null) return; Map<IEditorInput,IEditorPart> editors = new HashMap<IEditorInput,IEditorPart>(); - for (IEditorReference ref : window.getActivePage().getEditorReferences()) { - IEditorPart editor = ref.getEditor(false); - if (editor == null) continue; - editors.put(editor.getEditorInput(), editor); - } Map<IViewPart,ITCFDisassemblyPart> views = new HashMap<IViewPart,ITCFDisassemblyPart>(); - for (IViewReference ref : window.getActivePage().getViewReferences()) { - IViewPart view = ref.getView(false); - if (view == null) continue; - ITCFDisassemblyPart disasm = (ITCFDisassemblyPart)view.getAdapter(ITCFDisassemblyPart.class); - if (disasm != null) views.put(view, disasm); + IWorkbenchPage page = window.getActivePage(); + if (page != null) { + for (IEditorReference ref : page.getEditorReferences()) { + IEditorPart editor = ref.getEditor(false); + if (editor == null) continue; + editors.put(editor.getEditorInput(), editor); + } + for (IViewReference ref : page.getViewReferences()) { + IViewPart view = ref.getView(false); + if (view == null) continue; + ITCFDisassemblyPart disasm = (ITCFDisassemblyPart)view.getAdapter(ITCFDisassemblyPart.class); + if (disasm != null) views.put(view, disasm); + } } boolean flush_all = node == null || |