Strip safely, avoid nil.strip errors

bug/bundler_fix
Tod Beardsley 2015-01-27 11:06:55 -06:00
parent 5b3d877b25
commit d8200c65a8
No known key found for this signature in database
GPG Key ID: BD63D0A3EA19CAAC
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class Metasploit4 < Msf::Post
def extract_key(path) def extract_key(path)
data = read_file(path) data = read_file(path)
keys = data.split(':').select { |k| k =~ /[0-9a-f]{32}/ } keys = data.split(':').select { |k| k =~ /[0-9a-f]{32}/ }
keys.first.strip keys.map {|k| k.strip}.first
end end
def download_key(paths) def download_key(paths)