diff --git a/lib/msf/core/payload_generator.rb b/lib/msf/core/payload_generator.rb index 74ee6b6c4e..2879093ba7 100644 --- a/lib/msf/core/payload_generator.rb +++ b/lib/msf/core/payload_generator.rb @@ -376,7 +376,7 @@ module Msf encoders << e if e end encoders.sort_by { |my_encoder| my_encoder.rank }.reverse - elsif badchars.present? + elsif !badchars.empty? && !badchars.nil? framework.encoders.each_module_ranked('Arch' => [arch], 'Platform' => platform_list) do |name, mod| e = framework.encoders.create(name) e.datastore.import_options_from_hash(datastore)