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:
authorJaime van Kessel <nallath@gmail.com>2019-02-26 13:16:40 +0300
committerGitHub <noreply@github.com>2019-02-26 13:16:40 +0300
commit3de9cab1e2b09243caa17e5a74eecf9b3c494c33 (patch)
tree0bf5f3672bd9167869aa0890d9df0465ba434ac7 /plugins/CuraDrive
parent889bc8a529fe221544d0330314bd6e730dee6f89 (diff)
parent53cc9cd18848f17232689e9268e8b9baff124201 (diff)
Merge pull request #5363 from Ultimaker/backup-list-response-error-handling
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)