summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/timeout.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index 43f26f5..9625db7 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -81,7 +81,7 @@ module Timeout
message ||= "execution expired".freeze
- if scheduler = Fiber.scheduler and scheduler.respond_to?(:timeout_raise)
+ if (scheduler = Fiber.scheduler)&.respond_to?(:timeout_raise)
return scheduler.timeout_raise(sec, klass || Error, message, &block)
end