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:
authorGhostkeeper <rubend@tutanota.com>2022-05-19 12:35:58 +0300
committerGhostkeeper <rubend@tutanota.com>2022-05-19 12:36:16 +0300
commit64b29779ca808119458eb52d0add91a87c9a25b6 (patch)
treebb188800025badb49f0cd011567c06071969ed89 /plugins/Marketplace
parentc41c59da131eb9762a49043d4e20389c5d61aba4 (diff)
Fix crash when server sends invalid JSON data
If readJSON fails, it puts an entry in the log and then returns None. This then crashes with a TypeError because you can't check for things to be in None. Fixes Sentry issue CURA-3V5.
Diffstat (limited to 'plugins/Marketplace')
-rw-r--r--plugins/Marketplace/LocalPackageList.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/Marketplace/LocalPackageList.py b/plugins/Marketplace/LocalPackageList.py
index ae719b2699..85f835980b 100644
--- a/plugins/Marketplace/LocalPackageList.py
+++ b/plugins/Marketplace/LocalPackageList.py
@@ -108,7 +108,7 @@ class LocalPackageList(PackageList):
:param reply: A reply containing information about a number of packages.
"""
response_data = HttpRequestManager.readJSON(reply)
- if "data" not in response_data:
+ if response_data is None or "data" not in response_data:
Logger.error(
f"Could not interpret the server's response. Missing 'data' from response data. Keys in response: {response_data.keys()}")
return