Skip to content

Commit 585fac0

Browse files
committed
Fix nil bug when creating nonexistent encoder
Found by irthewinner on IRC.
1 parent e026a8c commit 585fac0

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)