From 9ced34a87c323b5d07dd203de990d9081d13d792 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Thu, 21 Jul 2022 04:16:08 -0700 Subject: [PATCH] [Playlist Insert] Add a further bodge fix I wish people would stop adding files to the playlist while there's a search filter in place. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistController.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 018d30543..7cddbb543 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -892,7 +892,14 @@ static void *playlistControllerContext = &playlistControllerContext; pe.deLeted = NO; } - [super insertObjects:objects atArrangedObjectIndexes:indexes]; + // further bodge fix + @try { + [super insertObjects:objects atArrangedObjectIndexes:indexes]; + } + @catch(id anException) { + indexes = [NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(count, [objects count])]; + [super insertObjects:objects atArrangedObjectIndexes:indexes]; + } [self commitPersistentStore];