[Table Views] Add a safety check to cell creation

Cell creation may create some other type of view, somehow. No idea how.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
xcode15
Christopher Snowhill 2022-07-07 16:37:42 -07:00
parent 3d1be2ca0d
commit 812da2e331
3 changed files with 3 additions and 3 deletions

View File

@ -495,7 +495,7 @@ static void *playlistControllerContext = &playlistControllerContext;
}
NSView *view = [tableView makeViewWithIdentifier:cellIdentifier owner:nil];
if(view) {
if(view && [view isKindOfClass:[NSTableCellView class]]) {
NSTableCellView *cellView = (NSTableCellView *)view;
NSRect frameRect = cellView.frame;
frameRect.origin.y = 1;

View File

@ -67,7 +67,7 @@
}
NSView *view = [tableView makeViewWithIdentifier:cellIdentifier owner:nil];
if(view) {
if(view && [view isKindOfClass:[NSTableCellView class]]) {
NSTableCellView *cellView = (NSTableCellView *)view;
if(cellView.textField) {

View File

@ -153,7 +153,7 @@
}
NSView *view = [tableView makeViewWithIdentifier:cellIdentifier owner:nil];
if(view) {
if(view && [view isKindOfClass:[NSTableCellView class]]) {
NSTableCellView *cellView = (NSTableCellView *)view;
if(cellView.textField) {