summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorEtienne Bergeron2013-11-27 19:48:26 (EST)
committer Genevieve Bastien2013-11-28 09:55:43 (EST)
commit83ff34deba3f46dd10651fd89ec401e2dade48a9 (patch)
tree49538a65103ed81a8ee4cb43e11df04f883cc0d7
parente1f3cac735000bd2b3803952814b30039679e36c (diff)
downloadorg.eclipse.linuxtools-83ff34deba3f46dd10651fd89ec401e2dade48a9.zip
org.eclipse.linuxtools-83ff34deba3f46dd10651fd89ec401e2dade48a9.tar.gz
org.eclipse.linuxtools-83ff34deba3f46dd10651fd89ec401e2dade48a9.tar.bz2
tmf: Fix NPE in the TimeGraphControl.refs/changes/25/19025/3
On TMF startup, the variable fEventColorMap may be <null>. for (Color color : fEventColorMap) { Change-Id: I83db13bffa93c4c1fbbcbc21198f3660b56866b3 Signed-off-by: Etienne Bergeron <etienne.bergeron@gmail.com> Reviewed-on: https://git.eclipse.org/r/19025 Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Hudson CI Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
index 3f44921..9defd7e 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
@@ -235,11 +235,6 @@ public class TimeGraphControl extends TimeGraphBaseControl
((ITimeGraphPresentationProvider2) timeGraphProvider).addColorListener(this);
}
- if (fEventColorMap != null) {
- for (Color color : fEventColorMap) {
- fResourceManager.destroyColor(color.getRGB());
- }
- }
StateItem[] stateItems = fTimeGraphProvider.getStateTable();
colorSettingsChanged(stateItems);
}
@@ -2418,8 +2413,10 @@ public class TimeGraphControl extends TimeGraphBaseControl
@Override
public void colorSettingsChanged(StateItem[] stateItems) {
/* Destroy previous colors from the resource manager */
- for (Color color : fEventColorMap) {
- fResourceManager.destroyColor(color.getRGB());
+ if (fEventColorMap != null) {
+ for (Color color : fEventColorMap) {
+ fResourceManager.destroyColor(color.getRGB());
+ }
}
if (stateItems != null) {
fEventColorMap = new Color[stateItems.length];