Skip to content

Commit

Permalink
Account for possible null heap in TimerHeap#steal
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Feb 19, 2024
1 parent 02f1c9d commit 0927d34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/jvm/src/main/scala/cats/effect/unsafe/TimerHeap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ private final class TimerHeap extends AtomicInteger {
} else false

val heap = this.heap // local copy
val size = Math.min(this.size, heap.length - 1)
go(heap, size, 1)
if (heap ne null) {
val size = Math.min(this.size, heap.length - 1)
go(heap, size, 1)
} else false
}

/**
Expand Down

0 comments on commit 0927d34

Please sign in to comment.