1
0
Fork 0
forked from OpenNeo/impress

fix NoMethodError when pet not found

Looks like I forgot to update the RemoteGateway code to consider
that RocketAMF now returns strings. Like in the Pet code, I opted
to dump it into a HashWithIndifferentAccess rather than assume
that we'll forever use strings and it'll never get switched back
to symbols.
This commit is contained in:
Emi Matchu 2013-04-25 16:39:13 -05:00
parent fae0a48bb7
commit edc61e9cb4

View file

@ -49,7 +49,7 @@ module RocketAMF
raise ConnectionError, e.message, e.backtrace raise ConnectionError, e.message, e.backtrace
end end
first_message_data = result.messages[0].data first_message_data = HashWithIndifferentAccess.new(result.messages[0].data)
if first_message_data.respond_to?(:[]) && first_message_data[:code] == ERROR_CODE if first_message_data.respond_to?(:[]) && first_message_data[:code] == ERROR_CODE
raise AMFError.new(first_message_data) raise AMFError.new(first_message_data)
end end