mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Fix for NPE by Andrey Eremchenko.
This commit is contained in:
parent
9e59c7ce08
commit
9827475e98
1 changed files with 3 additions and 3 deletions
|
@ -304,14 +304,14 @@ public abstract class PDOMSearchQuery implements ISearchQuery {
|
|||
if (localMatches.isEmpty())
|
||||
return;
|
||||
// Search for dirty editor
|
||||
ITextEditor dirtyTextEditor = null;
|
||||
ITextEditor dirtyTextEditor = null;
|
||||
String fullPath = ast.getFilePath();
|
||||
for (IEditorPart editorPart : CUIPlugin.getDirtyEditors()) {
|
||||
if (editorPart instanceof ITextEditor) {
|
||||
ITextEditor textEditor = (ITextEditor)editorPart;
|
||||
ITextEditor textEditor = (ITextEditor) editorPart;
|
||||
IEditorInput editorInput = editorPart.getEditorInput();
|
||||
if (editorInput instanceof IPathEditorInput) {
|
||||
IPathEditorInput pathEditorInput = (IPathEditorInput)editorInput;
|
||||
IPathEditorInput pathEditorInput = (IPathEditorInput) editorInput;
|
||||
IPath path = pathEditorInput.getPath();
|
||||
if (fullPath.equals(path.toOSString())) {
|
||||
dirtyTextEditor = textEditor;
|
||||
|
|
Loading…
Add table
Reference in a new issue