Skip to content

Commit

Permalink
Merge pull request jruby#7869 from enebo/get_cause
Browse files Browse the repository at this point in the history
Make sure Ruby exception does not provide itself as cause.
  • Loading branch information
enebo authored Aug 1, 2023
2 parents 42dd138 + b12e89e commit 4cd8ee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyException.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public void setCause(IRubyObject cause) {

// NOTE: can not have IRubyObject as NativeException has getCause() returning Throwable
public Object getCause() {
return cause;
return cause == this ? null : cause;
}

public RubyStackTraceElement[] getBacktraceElements() {
Expand Down

0 comments on commit 4cd8ee1

Please sign in to comment.