diff --git a/lib/pardot/authentication.rb b/lib/pardot/authentication.rb index b56f1c4..84821b8 100644 --- a/lib/pardot/authentication.rb +++ b/lib/pardot/authentication.rb @@ -3,7 +3,7 @@ module Authentication def authenticate resp = post "login", nil, :email => @email, :password => @password, :user_key => @user_key - @api_key = resp["api_key"] + @api_key = resp && resp["api_key"] end def authenticated?