aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisterFunny01 <38401696+SashaSemenishchev@users.noreply.github.com>2023-08-27 22:19:11 +0200
committerGitHub <noreply@github.com>2023-08-27 21:19:11 +0100
commit3c0c141189a0af706dfab9d052a2fd47d1906b39 (patch)
tree10285f8a90c7405ce7899be7195929098c30ca39
parentca65bac7c5b72734fc9247940717f403fea879d7 (diff)
downloadspark-3c0c141189a0af706dfab9d052a2fd47d1906b39.tar.gz
spark-3c0c141189a0af706dfab9d052a2fd47d1906b39.tar.bz2
spark-3c0c141189a0af706dfab9d052a2fd47d1906b39.zip
Fix parsing null async profiler segments (#354)
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/sampler/async/ProfileSegment.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/ProfileSegment.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/ProfileSegment.java
index 0804ccf..f20c969 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/ProfileSegment.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/ProfileSegment.java
@@ -65,7 +65,7 @@ public class ProfileSegment {
public static ProfileSegment parseSegment(JfrReader reader, JfrReader.Event sample, String threadName, long value) {
JfrReader.StackTrace stackTrace = reader.stackTraces.get(sample.stackTraceId);
- int len = stackTrace.methods.length;
+ int len = stackTrace != null ? stackTrace.methods.length : 0;
AsyncStackTraceElement[] stack = new AsyncStackTraceElement[len];
for (int i = 0; i < len; i++) {