mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-19 07:27:29 +08:00
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.
This commit is contained in:
parent
c41c59da13
commit
64b29779ca
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user