Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChrisTerBeke <c.terbeke@ultimaker.com>2019-02-26 13:09:57 +0300
committerChrisTerBeke <c.terbeke@ultimaker.com>2019-02-26 13:09:57 +0300
commit53cc9cd18848f17232689e9268e8b9baff124201 (patch)
treefda9808c451906745fc12bddc9243b080f1e76a7 /plugins/CuraDrive
parent2694ef98e07a547e43ed08943d2cfaf3b02692c4 (diff)
Add extra validation to backup list response
Diffstat (limited to 'plugins/CuraDrive')
-rw-r--r--plugins/CuraDrive/src/DriveApiService.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/CuraDrive/src/DriveApiService.py b/plugins/CuraDrive/src/DriveApiService.py
index 6a828e32d6..49e242d851 100644
--- a/plugins/CuraDrive/src/DriveApiService.py
+++ b/plugins/CuraDrive/src/DriveApiService.py
@@ -54,7 +54,13 @@ class DriveApiService:
Logger.log("w", "Could not get backups list from remote: %s", backup_list_request.text)
Message(catalog.i18nc("@info:backup_status", "There was an error listing your backups."), title = catalog.i18nc("@info:title", "Backup")).show()
return []
- return backup_list_request.json()["data"]
+
+ backup_list_response = backup_list_request.json()
+ if "data" not in backup_list_response:
+ Logger.log("w", "Could not get backups from remote, actual response body was: %s", str(backup_list_response))
+ return []
+
+ return backup_list_response["data"]
def createBackup(self) -> None:
self.creatingStateChanged.emit(is_creating = True)