Commit ba6f6246 authored by Carola's avatar Carola
Browse files

fix crash selecting items, pressing createFolder and selecting a folder

parent f3afa27f
......@@ -621,8 +621,8 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
if (self.editing) {
if (_libraryMode == VLCLibraryModeCreateFolder) {
_folderObject = _foundMedia[indexPath.item];
_libraryMode = _previousLibraryMode;
[self createFolderWithName:nil];
_libraryMode = _previousLibraryMode;
}
[(VLCPlaylistCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath] selectionUpdate];
return;
......@@ -806,6 +806,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
if ([folder.files count] == 0) {
[self removeMediaObject:folder updateDatabase:YES];
[self setEditing:NO];
[self backToAllItems:nil];
}
}
......@@ -854,8 +855,11 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
for (NSInteger i = [_indexPaths count] - 1; i >= 0; i--) {
NSIndexPath *path = _indexPaths[i];
if (![_foundMedia[path.row] isKindOfClass:[MLFile class]])
if (_libraryMode != VLCLibraryModeCreateFolder && ![_foundMedia[path.row] isKindOfClass:[MLFile class]])
continue;
if (_libraryMode == VLCLibraryModeCreateFolder)
[self updateViewContents];
MLFile *file = _foundMedia[path.row];
file.labels = [NSSet setWithObjects:label, nil];
[_foundMedia removeObjectAtIndex:path.row];
......
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