1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +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

@ -308,10 +308,10 @@ public abstract class PDOMSearchQuery implements ISearchQuery {
String fullPath = ast.getFilePath(); String fullPath = ast.getFilePath();
for (IEditorPart editorPart : CUIPlugin.getDirtyEditors()) { for (IEditorPart editorPart : CUIPlugin.getDirtyEditors()) {
if (editorPart instanceof ITextEditor) { if (editorPart instanceof ITextEditor) {
ITextEditor textEditor = (ITextEditor)editorPart; ITextEditor textEditor = (ITextEditor) editorPart;
IEditorInput editorInput = editorPart.getEditorInput(); IEditorInput editorInput = editorPart.getEditorInput();
if (editorInput instanceof IPathEditorInput) { if (editorInput instanceof IPathEditorInput) {
IPathEditorInput pathEditorInput = (IPathEditorInput)editorInput; IPathEditorInput pathEditorInput = (IPathEditorInput) editorInput;
IPath path = pathEditorInput.getPath(); IPath path = pathEditorInput.getPath();
if (fullPath.equals(path.toOSString())) { if (fullPath.equals(path.toOSString())) {
dirtyTextEditor = textEditor; dirtyTextEditor = textEditor;