Fix AttributeError when provider is temporarily unavailable (#3157)
authorDavid Bishop <teancom@users.noreply.github.com>
Mon, 16 Feb 2026 08:24:19 +0000 (00:24 -0800)
committerGitHub <noreply@github.com>
Mon, 16 Feb 2026 08:24:19 +0000 (09:24 +0100)
commitfdf1ad5e6ad69dfbb8361cc753cc1e21bd3a05d0
tree5e9b5970a4bf9c2cd7727c949a0b9531794de2b2
parente1b5cc19ecbf1143f5ca44eb081658701f9783a2
Fix AttributeError when provider is temporarily unavailable (#3157)

get_provider() can return None when a provider is temporarily
unavailable (e.g., during reload or network issues). Both
remove_item_from_library() and add_item_to_library() call
.library_edit_supported() on the result without a None check,
causing an AttributeError that surfaces as a 500 error.

Co-authored-by: David Bishop <git@gnuconsulting.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
music_assistant/controllers/music.py