Merge pull request #10571 from f321x/nwc_handle_null_params

plugin: nwc: handle 'params: null' in request
This commit is contained in:
ThomasV
2026-04-07 13:37:53 +02:00
committed by GitHub
+2 -2
View File
@@ -344,9 +344,9 @@ class NWCServer(Logger, EventListener):
content = json.loads(content)
if not isinstance(content, dict):
raise Exception("malformed content, not dict")
params: dict = content.get('params', {})
params: dict = content.get('params') or {} # some clients send 'params: null' or no params key at all
if not isinstance(params, dict):
raise Exception("malformed params, not dict")
raise Exception(f"malformed params, not dict: {content=}")
except Exception:
self.logger.debug(f"Invalid request event content: {event.content}", exc_info=True)
continue