File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,15 @@ private void processSnapshotsAndSetTags(
146146 int maxSnapshotSize = Math .min (snapshots .size (), maxCapturedFrames );
147147 for (int i = 0 ; i < maxSnapshotSize ; i ++) {
148148 Snapshot snapshot = snapshots .get (i );
149+ int chainedExceptionIdx = snapshot .getChainedExceptionIdx ();
150+ if (chainedExceptionIdx >= chainedExceptions .size ()) {
151+ LOGGER .debug (
152+ "Chained exception for snapshot={} is out of bounds: {}/{}" ,
153+ snapshot .getId (),
154+ chainedExceptionIdx ,
155+ chainedExceptions .size ());
156+ continue ;
157+ }
149158 Throwable currentEx = chainedExceptions .get (snapshot .getChainedExceptionIdx ());
150159 int [] mapping = createThrowableMapping (currentEx , t );
151160 StackTraceElement [] innerTrace = currentEx .getStackTrace ();
You can’t perform that action at this time.
0 commit comments