From 9451f462781ce1967870c5daa140e083142b593a Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Fri, 30 Oct 2015 09:09:06 -0400 Subject: [PATCH] analysis: Add null check for dependent analysis 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 Reviewed-on: https://git.eclipse.org/r/59045 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam --- .../SystemCallLatencyStatisticsAnalysisModule.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java index fef5f397cb..1d39a5cb23 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java @@ -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(); } -- 2.34.1