Simplify logic

bug/bundler_fix
James Lee 2015-01-27 09:05:11 -06:00
parent 5985f37fe8
commit a2c7ebc2b1
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
2 changed files with 4 additions and 4 deletions

View File

@ -888,12 +888,12 @@ class Db
query.find_each do |core|
# Exclude non-blank username creds if that's what we're after
if user && user.empty? && !(core.public && core.public.username.blank?)
if user == "" && !(core.public && core.public.username.blank?)
next
end
# Exclude non-blank password creds if that's what we're after
if pass && pass.empty? && !(core.private && core.private.data.blank?)
if pass == "" && !(core.private && core.private.data.blank?)
next
end

View File

@ -145,7 +145,7 @@ describe Msf::Ui::Console::CommandDispatcher::Db do
context "and when the username is blank" do
it "should show a user that matches the given expression" do
db.cmd_creds("-u", blank_username )
db.cmd_creds("-u", blank_username)
@output.should =~ [
"Credentials",
"===========",
@ -158,7 +158,7 @@ describe Msf::Ui::Console::CommandDispatcher::Db do
end
context "and when the password is blank" do
it "should show a user that matches the given expression" do
db.cmd_creds("-P", blank_password )
db.cmd_creds("-P", blank_password)
@output.should =~ [
"Credentials",
"===========",