Browse Source

no data handling

kunickyd 3 năm trước cách đây
mục cha
commit
ff00a0cf1e
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      app.py

+ 3 - 0
app.py

@@ -52,6 +52,9 @@ def get_account_assets(accountId): #TODO: add validation and error handling
     response = Assets()
     response.assets = []
 
+    if len(data) < 1:
+        return '', 204
+
     for asset in data:
         response.assets.append(Asset(asset.asset_id, asset.balance))