diff options
author | ChrisTerBeke <c.terbeke@ultimaker.com> | 2019-02-26 13:09:57 +0300 |
---|---|---|
committer | ChrisTerBeke <c.terbeke@ultimaker.com> | 2019-02-26 13:09:57 +0300 |
commit | 53cc9cd18848f17232689e9268e8b9baff124201 (patch) | |
tree | fda9808c451906745fc12bddc9243b080f1e76a7 /plugins/CuraDrive | |
parent | 2694ef98e07a547e43ed08943d2cfaf3b02692c4 (diff) |
Add extra validation to backup list response
Diffstat (limited to 'plugins/CuraDrive')
-rw-r--r-- | plugins/CuraDrive/src/DriveApiService.py | 8 |
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) |