Browse Source

iOS: Fix empty selection deletion with CollectionView

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 years ago
parent
commit
7060eeb4e3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Sources/VLCLibraryViewController.m

+ 1 - 1
Sources/VLCLibraryViewController.m

@@ -1404,7 +1404,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
 {
     NSArray *indexPaths = [self usingTableViewToShowData] ? [self.tableView indexPathsForSelectedRows] : [self.collectionView indexPathsForSelectedItems];
 
-    if (!indexPaths && !_deleteFromTableView) {
+    if ((!indexPaths || [indexPaths count] == 0) && !_deleteFromTableView) {
         UIAlertController *invalidSelection = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"DELETE_INVALID_TITLE", nil) message:NSLocalizedString(@"DELETE_INVALID_MESSAGE", nil) preferredStyle:UIAlertControllerStyleAlert];
         UIAlertAction *doneAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_OK", nil) style:UIAlertActionStyleDefault handler:nil];