From 0d9fbe798a46f0a7a80840faee25cb1d22b85d08 Mon Sep 17 00:00:00 2001 From: David Maloney Date: Fri, 5 Sep 2014 16:06:58 -0500 Subject: [PATCH] turn nil publics and privates into blanks don't pass nil into the credential object, pass an empty string instead this is the expected behaviour and avoids stack traces --- app/concerns/metasploit/credential/core/to_credential.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/concerns/metasploit/credential/core/to_credential.rb b/app/concerns/metasploit/credential/core/to_credential.rb index bfa804f1cb..af91fc4938 100644 --- a/app/concerns/metasploit/credential/core/to_credential.rb +++ b/app/concerns/metasploit/credential/core/to_credential.rb @@ -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),