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.
This commit is contained in:
Max Kellermann 2010-05-30 23:38:56 +02:00
parent d60bcd2869
commit 980201a665

View File

@ -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);