浏览代码

no data handling

kunickyd 3 年之前
父节点
当前提交
ff00a0cf1e
共有 1 个文件被更改,包括 3 次插入0 次删除
  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))