mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
fixed NPE on init
This commit is contained in:
parent
24b55c3712
commit
bea720fa70
1 changed files with 6 additions and 5 deletions
|
@ -63,12 +63,13 @@ public class RenameRefactoringAction extends SelectionDispatchAction {
|
|||
}
|
||||
if((element == null) || (element instanceof ITranslationUnit)){
|
||||
enable = false;
|
||||
}
|
||||
} else {
|
||||
ITextSelection textSelection= (ITextSelection)fEditor.getSelectionProvider().getSelection();
|
||||
if( (((CElement)element).getIdStartPos() != textSelection.getOffset())
|
||||
|| (((CElement)element).getIdLength() != textSelection.getLength())) {
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
setEnabled(enable);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue