Fix a crash that could happens when trying to delete multiple tracks with the metadata row selected.
This commit is contained in:
1 parent
c482bb5e8f
commit
8d5fcf9d22
1 file changed
+5
-2
@@ -518,7 +518,8 @@ static NSDictionary *_detailMonospacedAttr;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (toolbarItem == deleteTrack) {
|
if (toolbarItem == deleteTrack) {
|
||||||
return self.tracksTable.selectedRow > 0 && NSApp.active;
|
NSIndexSet *indexes = self.tracksTable.selectedRowIndexes;
|
||||||
|
return (indexes.count && ![self.tracksTable.selectedRowIndexes containsIndex:0] && NSApp.isActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toolbarItem == searchMetadata) {
|
if (toolbarItem == searchMetadata) {
|
||||||
@@ -949,7 +950,9 @@ static NSDictionary *_detailMonospacedAttr;
|
|||||||
}
|
}
|
||||||
|
|
||||||
[self.tracksTable.selectedRowIndexes enumerateIndexesUsingBlock:^(NSUInteger index, BOOL *stop) {
|
[self.tracksTable.selectedRowIndexes enumerateIndexesUsingBlock:^(NSUInteger index, BOOL *stop) {
|
||||||
[trackIndexes addIndex:[self trackIndexAtAtTableRow:index]];
|
if (index > 0) {
|
||||||
|
[trackIndexes addIndex:[self trackIndexAtAtTableRow:index]];
|
||||||
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.mp4 removeTracksAtIndexes:trackIndexes];
|
[self.mp4 removeTracksAtIndexes:trackIndexes];
|
||||||
|
|||||||
Reference in new issue
Block a user