Commit a354572f authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

Fix runtime exception

(cherry picked from commit e7edd115)
parent e7ca324d
......@@ -1144,14 +1144,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