Commit 980201a6 authored by Max Kellermann's avatar Max Kellermann

inotify_update: fix assertion failure when music dir is deleted

This shouldn't really happen, but insane users might delete/rename the music directory while MPD runs. What was even more insane was that MPD crashed due to this. This is a workaround - there is currently nothing useful we can do in this case; except maybe poll for the music directory to reappear, but that's too much trouble for a user error.
parent d60bcd28
......@@ -97,7 +97,13 @@ static void
remove_watch_directory(struct watch_directory *directory)
{
assert(directory != NULL);
assert(directory->parent != NULL);
if (directory->parent == NULL) {
g_warning("music directory was removed - "
"cannot continue to watch it");
return;
}
assert(directory->parent->children != NULL);
tree_remove_watch_directory(directory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment