Skip to content

Commit 286d3a4

Browse files
committed
[GR-17457] Handle a null backtrace in ThreadManager#setException
PullRequest: truffleruby/4108
2 parents 16e1906 + 54728bb commit 286d3a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/truffleruby/core/thread/ThreadManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private void setThreadValue(RubyThread thread, Object value) {
386386
private void setException(RubyThread thread, RubyException exception, Node currentNode) {
387387
// We materialize the backtrace eagerly here, as the exception escapes the thread and needs
388388
// to capture the backtrace from this thread.
389-
final RaiseException truffleException = exception.backtrace.getRaiseException();
389+
RaiseException truffleException = exception.backtrace == null ? null : exception.backtrace.getRaiseException();
390390
if (truffleException != null) {
391391
TruffleStackTrace.fillIn(truffleException);
392392
}

0 commit comments

Comments
 (0)