Skip to content

Commit

Permalink
Merge pull request stringer-rss#242 from gaynetdinov/fix-issue-in-fev…
Browse files Browse the repository at this point in the history
…er-authentication

undefined method `downcase' for nil:NilClass in FeverAPI
  • Loading branch information
matt swanson committed Jul 25, 2013
2 parents 70c4036 + 6befe29 commit f442704
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fever_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ class FeverAPI < Sinatra::Base
end

def authenticated?(api_key)
user = User.first
user.api_key && api_key.downcase == user.api_key.downcase
if api_key
user = User.first
user.api_key && api_key.downcase == user.api_key.downcase
end
end

get "/" do
Expand Down

0 comments on commit f442704

Please sign in to comment.