Explorar o código

fix crash selecting a folder and pressing the createFolderButton

note: don't alter a list while you enumerate it
Carola Nitz %!s(int64=11) %!d(string=hai) anos
pai
achega
f3afa27f1d
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Sources/VLCPlaylistViewController.m

+ 2 - 1
Sources/VLCPlaylistViewController.m

@@ -757,7 +757,8 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
     else
         _indexPaths = [NSMutableArray arrayWithArray:[self.tableView indexPathsForSelectedRows]];
 
-    for (NSIndexPath *path in _indexPaths) {
+    for (NSInteger i = _indexPaths.count - 1; i >=0; i--) {
+        NSIndexPath *path = _indexPaths[i];
         id mediaObject;
         if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
             mediaObject = _foundMedia[path.item];