Skip to content

Commit

Permalink
Convert to JSON only if the response is not nil
Browse files Browse the repository at this point in the history
Signed-off-by: Aravinda VK <[email protected]>
  • Loading branch information
aravindavk committed Jan 28, 2024
1 parent 736d123 commit 160499f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kadalu/binnacle/plugins/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def self.output_from_response(response)
case response_type
when 'json'
begin
outdata[:json] = JSON.parse(response.body)
outdata[:json] = JSON.parse(response.body) if response.body.is_a?(String)
rescue JSON::ParserError
outdata[:json] = nil
end
Expand Down

0 comments on commit 160499f

Please sign in to comment.