analysis: Add null check for dependent analysis
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Fri, 30 Oct 2015 13:09:06 +0000 (09:09 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Fri, 30 Oct 2015 18:46:38 +0000 (14:46 -0400)
This fixes a NPE and also avoids execution the statistics analysis on
other trace types than LTTng Kernel when the view is open.

Change-Id: I6583dcbb80044586f25067f32a5fbd9f28c7d4ed
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/59045
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java

index fef5f397cb7c5ddee49ab394fc6279987686d4bc..1d39a5cb23544ba2ccb01cdab03a6ba5eafb106a 100644 (file)
@@ -52,8 +52,10 @@ public class SystemCallLatencyStatisticsAnalysisModule extends TmfAbstractAnalys
         ITmfTrace trace = getTrace();
         if (trace != null) {
             SystemCallLatencyAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, checkNotNull(SystemCallLatencyAnalysis.ID));
-            fLatencyModule = module;
-            return checkNotNull(ImmutableList.of((IAnalysisModule) module));
+            if (module != null) {
+                fLatencyModule = module;
+                return checkNotNull(ImmutableList.of((IAnalysisModule) module));
+            }
         }
         return super.getDependentAnalyses();
     }
This page took 0.027022 seconds and 5 git commands to generate.