1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Fix for NPE by Andrey Eremchenko.

This commit is contained in:
Sergey Prigogin 2009-06-28 18:18:25 +00:00
parent 9e59c7ce08
commit 9827475e98

View file

@ -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;