lib/wialon_api/result.rb in wialon_api-0.0.6 vs lib/wialon_api/result.rb in wialon_api-0.0.7
- old
+ new
@@ -8,10 +8,10 @@
block.nil? ? result : block.call(result)
end
end
def self.extract_result(response)
- if response.error
+ if response.respond_to?(:error) && response.error
fail WialonApi::Error.new(response)
else
response
end
end