mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue