Skip to content

Commit

Permalink
ThreadContext.last_status can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Feb 11, 2025
1 parent 99fc366 commit 035d80b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import static org.jruby.api.Error.rangeError;
import static org.jruby.api.Warn.warn;
import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.Helpers.nullToNil;
import static org.jruby.runtime.Helpers.throwException;
import static org.jruby.runtime.Visibility.PRIVATE;
import static org.jruby.util.WindowsFFI.Kernel32.ERROR_INVALID_PARAMETER;
Expand Down Expand Up @@ -787,7 +788,7 @@ public static IRubyObject groups(ThreadContext context, IRubyObject recv) {

@JRubyMethod(name = "last_status", module = true, visibility = PRIVATE)
public static IRubyObject last_status(ThreadContext context, IRubyObject recv) {
return context.getLastExitStatus();
return nullToNil(context.getLastExitStatus(), context.nil);
}

@JRubyMethod(name = "setrlimit", module = true, visibility = PRIVATE)
Expand Down

0 comments on commit 035d80b

Please sign in to comment.