tmf: Bug 495219: Fix NPE in checkpoint indexer seeking on disposed trace
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / internal / tmf / core / trace / indexer / FlatArray.java
index a404a2c9ab0fbe49b0c55ac3c9f333e2fcc00fce..4df395d7dbf4efbdae37eb6790400201964222cf 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2016 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -90,6 +90,9 @@ public class FlatArray extends AbstractFileCheckpointCollection {
         ITmfCheckpoint checkpoint = null;
         try {
             long pos = getHeader().getSize() + fCheckpointSize * rank;
+            if (getRandomAccessFile() == null) {
+                return null;
+            }
             getRandomAccessFile().seek(pos);
             fByteBuffer.clear();
             getRandomAccessFile().read(fByteBuffer.array());
This page took 0.025101 seconds and 5 git commands to generate.