Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2010-01-12 13:03:38 +0000
committerMarkus Schorn2010-01-12 13:03:38 +0000
commitd989982488a253a9bfc75ef80dfb5af48ce9681d (patch)
tree52b2d007f34096d5a40e930c778ce78706172d52
parent647c85c5c0a36b3401851c6f5790b498dc022c81 (diff)
downloadorg.eclipse.cdt-d989982488a253a9bfc75ef80dfb5af48ce9681d.tar.gz
org.eclipse.cdt-d989982488a253a9bfc75ef80dfb5af48ce9681d.tar.xz
org.eclipse.cdt-d989982488a253a9bfc75ef80dfb5af48ce9681d.zip
Bug 299358: Protect against NPE.
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java
index d9b4961b89b..b24e435ca5d 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java
@@ -146,7 +146,9 @@ public class LineSearchElement extends PDOMSearchElement {
try {
// read the content of file
CodeReader reader = InternalParserUtil.createCodeReader(fileLocation, null);
- result = collectLineElements(reader.buffer, matches, fileLocation);
+ if (reader != null) {
+ result = collectLineElements(reader.buffer, matches, fileLocation);
+ }
} catch (IOException e) {
CUIPlugin.log(e);
} catch (CoreException e) {

Back to the top