Jelajahi Sumber

no data handling

kunickyd 3 tahun lalu
induk
melakukan
ff00a0cf1e
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  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))