Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

guard against nil response in error handler

  • Loading branch information...
commit 8434e8b71fa768c5a876c32fdedbad3201633347 1 parent b2840d0
@mislav authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  app.rb
View
2  app.rb
@@ -256,7 +256,7 @@ def photos_by_tag(tag)
Stats::record(:errors)
- if err.respond_to?(:response) and (body = err.response.body).is_a? Hash
+ if err.respond_to?(:response) and (body = err.response && err.response.body).is_a? Hash
msg = if body['meta']
"%s: %s" % [ body['meta']['error_type'], body['meta']['error_message'] ]
else
Please sign in to comment.
Something went wrong with that request. Please try again.