Skip to content

Commit 4cd8ee1

Browse files
authored
Merge pull request jruby#7869 from enebo/get_cause
Make sure Ruby exception does not provide itself as cause.
2 parents 42dd138 + b12e89e commit 4cd8ee1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/jruby/RubyException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public void setCause(IRubyObject cause) {
409409

410410
// NOTE: can not have IRubyObject as NativeException has getCause() returning Throwable
411411
public Object getCause() {
412-
return cause;
412+
return cause == this ? null : cause;
413413
}
414414

415415
public RubyStackTraceElement[] getBacktraceElements() {

0 commit comments

Comments
 (0)