Skip to content

Commit

Permalink
turn nil publics and privates into blanks
Browse files Browse the repository at this point in the history
don't pass nil into the credential object, pass an empty string instead
this is the expected behaviour and avoids stack traces
  • Loading branch information
David Maloney authored and David Maloney committed Sep 5, 2014
1 parent 9a7d1b2 commit 0d9fbe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/concerns/metasploit/credential/core/to_credential.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module Metasploit::Credential::Core::ToCredential

def to_credential
Metasploit::Framework::Credential.new(
public: public.try(:username),
private: private.try(:data),
public: public.try(:username) || '',
private: private.try(:data) || '',
private_type: private.try(:type).try(:demodulize).try(:underscore).try(:to_sym),
realm: realm.try(:value),
realm_key: realm.try(:key),
Expand Down

0 comments on commit 0d9fbe7

Please sign in to comment.