From 2165370b05b82708729ab9a5ecc9db8db964b392 Mon Sep 17 00:00:00 2001 From: Arjan <44190435+vingerha@users.noreply.github.com> Date: Wed, 7 May 2025 08:26:59 +0200 Subject: [PATCH] Update utils.py --- src/linkplay/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/linkplay/utils.py b/src/linkplay/utils.py index cf16bcf..c37654d 100644 --- a/src/linkplay/utils.py +++ b/src/linkplay/utils.py @@ -78,6 +78,10 @@ async def session_call_api_json( """ try: result = await session_call_api(endpoint, session, command) + try: + json.loads(result) + except ValueError as e: + return {} return json.loads(result) # type: ignore except json.JSONDecodeError as jsonexc: url = API_ENDPOINT.format(endpoint, command)