Commit e7edd115 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Fix runtime exception

parent 2d3b2e3e
......@@ -1138,14 +1138,17 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
file.folderTrackNumber = @([label files].count - 1);
[_foundMedia removeObjectAtIndex:path.item];
} else {
id item = _foundMedia[path.row];
if (![item isKindOfClass:[MLFile class]])
continue;
MLFile *file = (MLFile *)item;
file.labels = [NSSet setWithObjects:label, nil];
file.folderTrackNumber = @([label files].count - 1);
[_foundMedia removeObjectAtIndex:path.row];
NSUInteger row = path.row;
if (row < _foundMedia.count) {
id item = _foundMedia[row];
if (![item isKindOfClass:[MLFile class]])
continue;
MLFile *file = (MLFile *)item;
file.labels = [NSSet setWithObjects:label, nil];
file.folderTrackNumber = @([label files].count - 1);
[_foundMedia removeObjectAtIndex: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