Skip to content

Commit

Permalink
Check null in a way that ErrorProne doesn't hate
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Oct 25, 2024
1 parent f0ad1a0 commit 30482cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.Iterator;
import java.util.Objects;
import java.util.Queue;
import java.util.Vector;
import java.util.WeakHashMap;
Expand Down Expand Up @@ -2579,7 +2580,7 @@ public static <StateType> IRubyObject uninterruptible(ThreadContext context, Sta
public IRubyObject setFiberScheduler(IRubyObject scheduler) {
// VM_ASSERT(ruby_thread_has_gvl_p());

scheduler.getClass(); // !null
Objects.requireNonNull(scheduler);

if (scheduler != null && !scheduler.isNil()) {
FiberScheduler.verifyInterface(scheduler);
Expand Down

0 comments on commit 30482cc

Please sign in to comment.