about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-20 06:22:14 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:19 -0500
commit14a11eaf3857be65a8a68d74d274fefe1355a529 (patch)
tree0fc74e119f1a607caf4c22fc47ec6f57775993f6
parent503319ec8f9c387ba758a5f8ac8d0249c9420c03 (diff)
[Bug] Check for empty JSON payload before continuing
-rw-r--r--app/services/keys/query_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/keys/query_service.rb b/app/services/keys/query_service.rb
index 286fbd834..f48dafb61 100644
--- a/app/services/keys/query_service.rb
+++ b/app/services/keys/query_service.rb
@@ -63,7 +63,7 @@ class Keys::QueryService < BaseService
 
     json = fetch_resource(@account.devices_url)
 
-    return if json['items'].blank?
+    return if json.blank? || json['items'].blank?
 
     @devices = json['items'].map do |device|
       Device.new(device_id: device['id'], name: device['name'], identity_key: device.dig('identityKey', 'publicKeyBase64'), fingerprint_key: device.dig('fingerprintKey', 'publicKeyBase64'), claim_url: device['claim'])