Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-08-20 17:58:45 +0000
committerJeff Johnston2018-08-20 21:32:11 +0000
commita551740847d245d8435d739400230dc7766b66ac (patch)
tree1f7114ed9912503eff1d676570d9f7579188b447
parentbde40588d98aaea7407173a507aba9a800cdc5cd (diff)
downloadorg.eclipse.linuxtools-a551740847d245d8435d739400230dc7766b66ac.tar.gz
org.eclipse.linuxtools-a551740847d245d8435d739400230dc7766b66ac.tar.xz
org.eclipse.linuxtools-a551740847d245d8435d739400230dc7766b66ac.zip
Bug 538098 - NullPointerException in GcovAnnotationModelTracker
- add null check in GcovAnnotationModelTracker.annotateCEditor Change-Id: Ifd656e774615b3e607a71c86c15481b70110c2eb Reviewed-on: https://git.eclipse.org/r/127721 Tested-by: CI Bot Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> (cherry picked from commit ba67f1ad12da4463a57d0c7f330f204354e78e1e) Reviewed-on: https://git.eclipse.org/r/127723
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/GcovAnnotationModelTracker.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/GcovAnnotationModelTracker.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/GcovAnnotationModelTracker.java
index c03572460f..ade6c1a0c7 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/GcovAnnotationModelTracker.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/GcovAnnotationModelTracker.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2014, 2018 Red Hat, Inc.
- *
+ *
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -159,6 +159,9 @@ public final class GcovAnnotationModelTracker {
if (part instanceof ICEditor) {
ICEditor editor = (ICEditor) part;
ICElement element = CDTUITools.getEditorInputCElement(editor.getEditorInput());
+ if (element == null) {
+ return;
+ }
IProject project = element.getCProject().getProject();
// Attach our annotation model to any compatible editor. (ICEditor)

Back to the top