Skip to content

Commit df5e67f

Browse files
committed
Only replace the body if a parser is found.
1 parent 6faff57 commit df5e67f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/async/rest/wrapper/generic.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def parser_for(response)
6565
# Wrap the response body in the given klass.
6666
def wrap_response(response)
6767
if body = response.body
68-
response.body = parser_for(response).new(body)
68+
if parser = parser_for(response)
69+
response.body = parser.new(body)
70+
end
6971
end
7072

7173
return response

0 commit comments

Comments
 (0)