From 378e6081c6ce13fededdbeefbd66c77435e7ff6f Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Fri, 13 Oct 2017 09:08:57 +0300 Subject: [PATCH] Fixed NPE in TimeSeriesEditor.ActiveRunListener refs #7544 Change-Id: Id9ba7f7d698b3a98b44cae80173fb686971658c0 --- .../charts/editor/TimeSeriesEditor.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bundles/org.simantics.charts/src/org/simantics/charts/editor/TimeSeriesEditor.java b/bundles/org.simantics.charts/src/org/simantics/charts/editor/TimeSeriesEditor.java index d83a37ad4..4f633fbe6 100644 --- a/bundles/org.simantics.charts/src/org/simantics/charts/editor/TimeSeriesEditor.java +++ b/bundles/org.simantics.charts/src/org/simantics/charts/editor/TimeSeriesEditor.java @@ -857,14 +857,14 @@ public class TimeSeriesEditor extends ResourceEditorPart { } @Override public void execute(ReadGraph graph, final Resource run) throws DatabaseException { - if(run != null) { - SimulationResource SIMU = SimulationResource.getInstance(graph); - Variable var = Variables.getVariable(graph, run); - IExperiment exp = var.getPossiblePropertyValue(graph, SIMU.Run_iExperiment); - ITrendSupport ts = exp.getService(ITrendSupport.class); - if (ts != null) - ts.setChartData(graph); - } + if(run != null) { + SimulationResource SIMU = SimulationResource.getInstance(graph); + Variable var = Variables.getPossibleVariable(graph, run); + IExperiment exp = var != null ? var.getPossiblePropertyValue(graph, SIMU.Run_iExperiment) : null; + ITrendSupport ts = exp != null ? exp.getService(ITrendSupport.class) : null; + if (ts != null) + ts.setChartData(graph); + } } @Override public boolean isDisposed() { -- 2.43.2