diff --git a/lib/msf/core/thread_manager.rb b/lib/msf/core/thread_manager.rb index 20ea7e7c99..4b9c7fb009 100644 --- a/lib/msf/core/thread_manager.rb +++ b/lib/msf/core/thread_manager.rb @@ -59,7 +59,9 @@ class ThreadManager < Array # XXX: Preserve Ruby < 2.5 thread exception reporting behavior # https://ruby-doc.org/core-2.5.0/Thread.html#method-c-report_on_exception - Thread.report_on_exception = false if Thread.report_on_exception + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.5.0') + Thread.report_on_exception = false if Thread.report_on_exception + end end #