mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Add extra validation to backup list response
This commit is contained in:
parent
2694ef98e0
commit
53cc9cd188
1 changed files with 7 additions and 1 deletions
|
@ -54,7 +54,13 @@ class DriveApiService:
|
||||||
Logger.log("w", "Could not get backups list from remote: %s", backup_list_request.text)
|
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()
|
Message(catalog.i18nc("@info:backup_status", "There was an error listing your backups."), title = catalog.i18nc("@info:title", "Backup")).show()
|
||||||
return []
|
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:
|
def createBackup(self) -> None:
|
||||||
self.creatingStateChanged.emit(is_creating = True)
|
self.creatingStateChanged.emit(is_creating = True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue