Skip to content
Snippets Groups Projects
Verified Commit a3a9111c authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Fix possible type error from hash/array misuse

parent 1079bf3e
No related branches found
No related tags found
No related merge requests found
Pipeline #7548 failed
...@@ -105,8 +105,9 @@ module Passwordstate ...@@ -105,8 +105,9 @@ module Passwordstate
return data if res_obj.is_a? Net::HTTPSuccess return data if res_obj.is_a? Net::HTTPSuccess
data = data&.first data = data&.first
data = data.fetch('errors', []) if data.is_a? Hash
raise Passwordstate::HTTPError.new_by_code(res_obj.code, req_obj, res_obj, data&.fetch('errors', []) || []) raise Passwordstate::HTTPError.new_by_code(res_obj.code, req_obj, res_obj, data || [])
else else
return res_obj.body if res_obj.is_a?(Net::HTTPSuccess) && options.fetch(:allow_html, true) return res_obj.body if res_obj.is_a?(Net::HTTPSuccess) && options.fetch(:allow_html, true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment