mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Fix NPE, related to bug 273306
This commit is contained in:
parent
56144f3f01
commit
5a07e05927
1 changed files with 12 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2008 QNX Software Systems and others.
|
* Copyright (c) 2004, 2009 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -289,13 +289,15 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
|
||||||
// some edge cases with broken behavior (273306). The solution is to
|
// some edge cases with broken behavior (273306). The solution is to
|
||||||
// force a selection change notification after we get loaded.
|
// force a selection change notification after we get loaded.
|
||||||
WorkbenchJob wjob = new WorkbenchJob("CDT Variable view action updater") { //$NON-NLS-1$
|
WorkbenchJob wjob = new WorkbenchJob("CDT Variable view action updater") { //$NON-NLS-1$
|
||||||
|
@Override
|
||||||
public IStatus runInUIThread(IProgressMonitor monitor) {
|
public IStatus runInUIThread(IProgressMonitor monitor) {
|
||||||
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
|
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
|
||||||
for (IWorkbenchWindow window : windows) {
|
for (IWorkbenchWindow window : windows) {
|
||||||
IWorkbenchPage[] pages = window.getPages();
|
IWorkbenchPage[] pages = window.getPages();
|
||||||
for (IWorkbenchPage page : pages) {
|
for (IWorkbenchPage page : pages) {
|
||||||
IViewReference viewRef = page.findViewReference(IDebugUIConstants.ID_VARIABLE_VIEW);
|
IViewReference viewRef = page.findViewReference(IDebugUIConstants.ID_VARIABLE_VIEW);
|
||||||
IViewPart part = viewRef.getView(true);
|
if (viewRef != null) {
|
||||||
|
IViewPart part = viewRef.getView(false);
|
||||||
if (part instanceof IDebugView) {
|
if (part instanceof IDebugView) {
|
||||||
Viewer viewer = ((IDebugView)part).getViewer();
|
Viewer viewer = ((IDebugView)part).getViewer();
|
||||||
if (viewer != null) {
|
if (viewer != null) {
|
||||||
|
@ -304,6 +306,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue