Skip to content

Commit

Permalink
maybe this is also FB's bug?
Browse files Browse the repository at this point in the history
close #350
close #351
  • Loading branch information
nov committed Mar 20, 2014
1 parent 2a125bb commit 042cd45
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/fb_graph/node.rb
Expand Up @@ -144,7 +144,16 @@ def handle_response
# You should handle this case without MultiJson.
response.body.gsub('"', '')
else
MultiJson.load(response.body).with_indifferent_access
hash_or_array = MultiJson.load(response.body)
case hash_or_array
when Hash
hash_or_array.with_indifferent_access
when Array
# NOTE:
# I think this case is FB's bug though.
# ref) https://github.com/nov/fb_graph/issues/350
hash_or_array.collect(&:with_indifferent_access)
end
end

if (200...300).include?(response.status)
Expand Down

0 comments on commit 042cd45

Please sign in to comment.