summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-07-15 02:26:20 (EDT)
committer Sergey Prigogin2013-07-17 14:56:18 (EDT)
commit34341139d975fecad466c8e2bb02974add40b23c (patch)
treed9e82df002d2246d65010a7eb020d2e96085c9d0
parentd76225e01d1b4ff45299113bba0a55c6f01fda3b (diff)
downloadorg.eclipse.cdt-34341139d975fecad466c8e2bb02974add40b23c.zip
org.eclipse.cdt-34341139d975fecad466c8e2bb02974add40b23c.tar.gz
org.eclipse.cdt-34341139d975fecad466c8e2bb02974add40b23c.tar.bz2
Bug 412463 - Fix an NPE
Change-Id: Ib38ca0033ee8db1123f8d6a2be990d17dccb9f14 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/14544 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java
index 6e75095..d4c703d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java
@@ -284,7 +284,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
int bestScore = -1;
for (IIndexFile file : files) {
int score = file.getMacros().length * 2;
- if (TranslationUnit.isSourceFile(TranslationUnit.getParsedInContext(file), tu.getCProject().getProject()))
+ if (tu != null && TranslationUnit.isSourceFile(TranslationUnit.getParsedInContext(file), tu.getCProject().getProject()))
score++;
if (score > bestScore) {
bestScore = score;