lttng.ust: Properly null-check the debug info state system
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 29 Jun 2016 21:25:33 +0000 (17:25 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 6 Jul 2016 03:48:11 +0000 (23:48 -0400)
When opening a trace, some views (callstack etc.) might request
binaries before the state system is properly loaded,
so the checkNotNull() check can fail. Actually reply that the
information is not available, instead of breaking the whole trace.

Change-Id: Iba14ac2ffac6f01d45bba4dba9f946372777b5db
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/76255
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Tested-by: Alexandre Montplaisir <alexmonthy@efficios.com>
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoAnalysisModule.java

index 6b6a78940b9fad998293478d8885e130cb6edb00..2fbe1aa2e78a8e7675624984f0d0156bf981d6e7 100644 (file)
@@ -116,7 +116,11 @@ public class UstDebugInfoAnalysisModule extends TmfStateSystemAnalysisModule {
      */
     public Collection<UstDebugInfoBinaryFile> getAllBinaries() {
         waitForCompletion();
-        ITmfStateSystem ss = checkNotNull(getStateSystem());
+        ITmfStateSystem ss = getStateSystem();
+        if (ss == null) {
+            /* State system might not yet be initialized */
+            return Collections.EMPTY_SET;
+        }
 
         Set<UstDebugInfoBinaryFile> files = new TreeSet<>();
         ImmutableList.Builder<Integer> builder = ImmutableList.builder();
This page took 0.02545 seconds and 5 git commands to generate.