Browse Source

Don't crash when cloud response is invalid JSON

Perhaps if the connection is interrupted this could happen.

Fixes Sentry issue CURA-1QX.
Ghostkeeper 4 years ago
parent
commit
577e45595e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      plugins/CuraDrive/src/DriveApiService.py

+ 4 - 0
plugins/CuraDrive/src/DriveApiService.py

@@ -43,6 +43,10 @@ class DriveApiService:
                 return
 
             backup_list_response = HttpRequestManager.readJSON(reply)
+            if backup_list_response is None:
+                Logger.error("List of back-ups can't be parsed.")
+                changed([])
+                return
             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))