From e004e19b69320309a517fb492137b0c85c08f38c Mon Sep 17 00:00:00 2001
From: Alexander Olofsson <alexander.olofsson@liu.se>
Date: Tue, 19 Oct 2021 17:24:37 +0200
Subject: [PATCH] Fix error handling

---
 lib/passwordstate/client.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/passwordstate/client.rb b/lib/passwordstate/client.rb
index c95f665..034044e 100644
--- a/lib/passwordstate/client.rb
+++ b/lib/passwordstate/client.rb
@@ -108,7 +108,7 @@ module Passwordstate
       if data
         return data if res_obj.is_a? Net::HTTPSuccess
 
-        parsed = data&.first
+        data = data.first if data.is_a? Array
         parsed = data.fetch('errors', []) if data.is_a?(Hash) && data.key?('errors')
         parsed = [data]
 
-- 
GitLab