From: Marcel van der Veldt Date: Sun, 22 Feb 2026 13:44:14 +0000 (+0100) Subject: More gracefully handle DLNA errors X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=f5bb22cf761a5fafd8af4cbeb3cb8ecf62485fd9;p=music-assistant-server.git More gracefully handle DLNA errors --- diff --git a/music_assistant/providers/dlna/helpers.py b/music_assistant/providers/dlna/helpers.py index 7258c49e..8f525eaf 100644 --- a/music_assistant/providers/dlna/helpers.py +++ b/music_assistant/providers/dlna/helpers.py @@ -2,6 +2,7 @@ from __future__ import annotations +import xml.etree.ElementTree as ET from typing import TYPE_CHECKING from aiohttp.web import Request, Response @@ -40,7 +41,15 @@ class DLNANotifyServer(UpnpNotifyServer): # type: ignore[misc,unused-ignore] body=await request.text(), ) - status = await self.event_handler.handle_notify(http_request) + try: + status = await self.event_handler.handle_notify(http_request) + except ET.ParseError as err: + self.mass.logger.debug( + "Ignoring malformed XML in DLNA notify from %s: %s", + request.remote, + err, + ) + return Response(status=400) return Response(status=status)