From 1b8b4e4e09177d62fbdfc85ed65fb9679494964a Mon Sep 17 00:00:00 2001 From: Valeri Gokadze Date: Wed, 14 May 2025 13:53:32 +0400 Subject: [PATCH] fix: log error when song URL retrieval fails --- lib/services/audio_service.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/services/audio_service.dart b/lib/services/audio_service.dart index 8abec85c..0666528a 100644 --- a/lib/services/audio_service.dart +++ b/lib/services/audio_service.dart @@ -299,6 +299,11 @@ class MusifyAudioHandler extends BaseAudioHandler { ? song['audioPath'] : await getSong(song['ytid'], song['isLive']); + if (songUrl == null) { + logger.log('Failed to get song URL for ${song['ytid']}', null, null); + return; + } + final audioSource = await buildAudioSource(song, songUrl, isOffline); await audioPlayer.setAudioSource(audioSource);