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:
parent
15a9ac904e
commit
d4aa4850c7
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue