From 577e45595ec5e421bd59c8ab9e7d9a8fd58252b9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 4 Feb 2021 17:05:45 +0100 Subject: [PATCH] Don't crash when cloud response is invalid JSON Perhaps if the connection is interrupted this could happen. Fixes Sentry issue CURA-1QX. --- plugins/CuraDrive/src/DriveApiService.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/CuraDrive/src/DriveApiService.py b/plugins/CuraDrive/src/DriveApiService.py index 2248b64389..754069dc9b 100644 --- a/plugins/CuraDrive/src/DriveApiService.py +++ b/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))