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,15 +89,16 @@ public abstract class AbstractTargetAction
|
|||
} else {
|
||||
fContainer = null;
|
||||
}
|
||||
} else if (selection instanceof ITextSelection)
|
||||
{ // key binding pressed inside active text editor
|
||||
} else if (selection instanceof ITextSelection) {
|
||||
// Key binding pressed inside active text editor
|
||||
fContainer= null;
|
||||
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());
|
||||
fContainer = file.getParent();
|
||||
} else {
|
||||
fContainer = null;
|
||||
}
|
||||
if (file != null) {
|
||||
fContainer = file.getParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fContainer != null && MakeCorePlugin.getDefault().getTargetManager().hasTargetBuilder(fContainer.getProject())) {
|
||||
isEnabled = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue