diff options
author | Bernd Hufmann | 2011-08-29 15:01:41 +0000 |
---|---|---|
committer | Bernd Hufmann | 2011-08-29 15:22:26 +0000 |
commit | 60f5b7bb70a6a34633f00e17bfaf1f6f12007e0e (patch) | |
tree | eafe3c4f8506fbd279226b48b338450d099410f2 /lttng/org.eclipse.linuxtools.lttng.jni | |
parent | 0903372ea297baf8619a84e9971001341549c525 (diff) | |
download | org.eclipse.linuxtools-60f5b7bb70a6a34633f00e17bfaf1f6f12007e0e.tar.gz org.eclipse.linuxtools-60f5b7bb70a6a34633f00e17bfaf1f6f12007e0e.tar.xz org.eclipse.linuxtools-60f5b7bb70a6a34633f00e17bfaf1f6f12007e0e.zip |
Fix for Bug 352379
Diffstat (limited to 'lttng/org.eclipse.linuxtools.lttng.jni')
-rw-r--r-- | lttng/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java b/lttng/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java index e009ff6f10..e3a3a76b87 100644 --- a/lttng/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java +++ b/lttng/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java @@ -491,12 +491,15 @@ public abstract class JniTrace extends Jni_C_Common { * Note : If the events were read before, the top event and the event * currently loaded (currentEvent) are most likely the same. * - * @return The top event in the stack or null if no event is available. + * @@return The top event in the stack or null if no event is available or if the heap is null. * * @see org.eclipse.linuxtools.lttng.jni.JniEvent */ public JniEvent findNextEvent() { - return eventsHeap.peek(); + if (eventsHeap != null) { + return eventsHeap.peek(); + } + return null; } /** @@ -510,7 +513,7 @@ public abstract class JniTrace extends Jni_C_Common { */ public JniEvent readNextEvent() { // Get the "next" event on the top of the heap but DO NOT remove it - JniEvent tmpEvent = eventsHeap.peek(); + JniEvent tmpEvent = findNextEvent(); // If the event is null, it was the last one in the trace we can leave // the function @@ -537,7 +540,7 @@ public abstract class JniTrace extends Jni_C_Common { } // Pick the top event again - tmpEvent = eventsHeap.peek(); + tmpEvent = findNextEvent(); // Save the event we just read as the "current event" currentEvent = tmpEvent; |