From: Bernd Hufmann Date: Fri, 30 Oct 2015 13:09:06 +0000 (-0400) Subject: analysis: Add null check for dependent analysis X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=9451f462781ce1967870c5daa140e083142b593a;p=deliverable%2Ftracecompass.git 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 --- 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(); }