Fix #21337: NoMethodError' 'undefined method `empty?' for nil

This commit is contained in:
g0t mi1k
2026-04-21 10:48:34 +01:00
parent 1142d4e15d
commit 2d93669f56
@@ -311,7 +311,7 @@ class MetasploitModule < Msf::Auxiliary
connect(versions: [1, 2, 3]) connect(versions: [1, 2, 3])
end end
smb_login smb_login
break unless enum_shares(ip).empty? break unless enum_shares(ip)&.empty?
rescue ::Interrupt rescue ::Interrupt
raise $ERROR_INFO raise $ERROR_INFO
rescue Errno::ECONNRESET => e rescue Errno::ECONNRESET => e