Handle TypeError in case of nil
This commit is contained in:
@@ -286,7 +286,7 @@ module Msf
|
||||
target_idx =
|
||||
begin
|
||||
Integer(datastore['TARGET'])
|
||||
rescue ArgumentError
|
||||
rescue ArgumentError, TypeError
|
||||
datastore['TARGET']
|
||||
end
|
||||
|
||||
|
||||
@@ -686,7 +686,7 @@ class Exploit < Msf::Module
|
||||
target_idx =
|
||||
begin
|
||||
Integer(datastore['TARGET'])
|
||||
rescue ArgumentError
|
||||
rescue ArgumentError, TypeError
|
||||
datastore['TARGET']
|
||||
end
|
||||
|
||||
|
||||
@@ -643,7 +643,7 @@ module Msf
|
||||
mod_index =
|
||||
begin
|
||||
Integer(mod_name) - 1
|
||||
rescue ArgumentError
|
||||
rescue ArgumentError, TypeError
|
||||
nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user