Handle the case when the vertical candidate data source is gone.
This commit is contained in:
parent
b0b5dd0233
commit
005437db28
|
@ -197,7 +197,13 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
|
||||
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
|
||||
{
|
||||
NSString *candidate = [_delegate candidateController:self candidateAtIndex:row];
|
||||
NSString *candidate = @"";
|
||||
|
||||
// rendering can occur when the delegate is already gone or data goes stale; in that case we ignore it
|
||||
|
||||
if (row < [_delegate candidateCountForController:self]) {
|
||||
candidate = [_delegate candidateController:self candidateAtIndex:row];
|
||||
}
|
||||
|
||||
NSAttributedString *attrString = [[[NSAttributedString alloc] initWithString:candidate attributes:[NSDictionary dictionaryWithObjectsAndKeys:_candidateFont, NSFontAttributeName, _candidateTextParagraphStyle, NSParagraphStyleAttributeName, nil]] autorelease];
|
||||
|
||||
|
|
Loading…
Reference in New Issue