1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 299358: Protect against NPE.

This commit is contained in:
Markus Schorn 2010-01-12 13:03:24 +00:00
parent 15a9ac904e
commit d4aa4850c7

View file

@ -146,9 +146,11 @@ public class LineSearchElement extends PDOMSearchElement {
// read the content of file
FileContent content = FileContent.create(fileLocation);
AbstractCharArray buf = ((InternalFileContent) content).getSource();
if (buf != null)
result = collectLineElements(buf, matches, fileLocation);
if (content != null) {
AbstractCharArray buf = ((InternalFileContent) content).getSource();
if (buf != null)
result = collectLineElements(buf, matches, fileLocation);
}
return result;
}