From b39f7d5d692432c503358ce6b5a6f104164cab6c Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Mon, 1 Nov 2010 13:44:16 +0000 Subject: Beforing asking SPTableView's delegate if we can right-click a particular row, remember to check that the delegate actually implements the method we are using. Fixes an issue when right-clicking an index in the table structure view, spotted by Hans. --- Source/SPTableView.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/SPTableView.m b/Source/SPTableView.m index d1aa5700..fd9c09d0 100644 --- a/Source/SPTableView.m +++ b/Source/SPTableView.m @@ -137,7 +137,12 @@ */ - (void)rightMouseDown:(NSEvent *)event { - if ([[self delegate] tableView:self shouldSelectRow:[self rowAtPoint:[self convertPoint:[event locationInWindow] fromView:nil]]]) { + if ([[self delegate] respondsToSelector:@selector(tableView:shouldSelectRow:)]) { + if ([[self delegate] tableView:self shouldSelectRow:[self rowAtPoint:[self convertPoint:[event locationInWindow] fromView:nil]]]) { + [super rightMouseDown:event]; + } + } + else { [super rightMouseDown:event]; } } -- cgit v1.2.3