Skip to content

Commit 2ab7a42

Browse files
committed
Land rapid7#8322, fix for nil bug in nonexistent encoder
2 parents a83a7a1 + 585fac0 commit 2ab7a42

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/msf/core/payload_generator.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ def get_encoders
411411
# Allow comma separated list of encoders so users can choose several
412412
encoder.split(',').each do |chosen_encoder|
413413
e = framework.encoders.create(chosen_encoder)
414+
if e.nil?
415+
cli_print "Skipping invalid encoder #{chosen_encoder}"
416+
next
417+
end
414418
e.datastore.import_options_from_hash(datastore)
415419
encoders << e if e
416420
end

0 commit comments

Comments
 (0)