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:
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())
|
if (localMatches.isEmpty())
|
||||||
return;
|
return;
|
||||||
// Search for dirty editor
|
// Search for dirty editor
|
||||||
ITextEditor dirtyTextEditor = null;
|
ITextEditor dirtyTextEditor = null;
|
||||||
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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue