mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 302109: NPE on selection changes.
This commit is contained in:
parent
a4fe48870e
commit
3e23c44676
1 changed files with 8 additions and 7 deletions
|
@ -89,14 +89,15 @@ public abstract class AbstractTargetAction
|
||||||
} else {
|
} else {
|
||||||
fContainer = null;
|
fContainer = null;
|
||||||
}
|
}
|
||||||
} else if (selection instanceof ITextSelection)
|
} else if (selection instanceof ITextSelection) {
|
||||||
{ // key binding pressed inside active text editor
|
// Key binding pressed inside active text editor
|
||||||
|
fContainer= null;
|
||||||
IWorkbenchPart part = fPart != null ? fPart : fWindow.getActivePage().getActivePart();
|
IWorkbenchPart part = fPart != null ? fPart : fWindow.getActivePage().getActivePart();
|
||||||
if ( part instanceof TextEditor ) {
|
if (part instanceof TextEditor) {
|
||||||
IFile file = org.eclipse.ui.ide.ResourceUtil.getFile(((EditorPart) part).getEditorInput());
|
IFile file = org.eclipse.ui.ide.ResourceUtil.getFile(((EditorPart) part).getEditorInput());
|
||||||
|
if (file != null) {
|
||||||
fContainer = file.getParent();
|
fContainer = file.getParent();
|
||||||
} else {
|
}
|
||||||
fContainer = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fContainer != null && MakeCorePlugin.getDefault().getTargetManager().hasTargetBuilder(fContainer.getProject())) {
|
if (fContainer != null && MakeCorePlugin.getDefault().getTargetManager().hasTargetBuilder(fContainer.getProject())) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue