Only message the delegate if the line actually exists
authorRobert Sesek <rsesek@bluestatic.org>
Fri, 14 Jan 2011 14:54:51 +0000 (09:54 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 16 Jan 2011 04:45:10 +0000 (23:45 -0500)
Source/BSLineNumberRulerView.mm

index 33c5f5ce4aa5718d07e92e168fe2e90d2dd39632..66647d65d8e238e828f9a53775b96a5dcc0ae077 100644 (file)
@@ -185,7 +185,8 @@ const CGFloat kRulerRightPadding = 2.5;
   NSPoint point = [theEvent locationInWindow];
   point = [self convertPoint:point fromView:nil];
   NSUInteger line = [self lineNumberAtPoint:point];
-  [sourceView_.delegate gutterClickedAtLine:line forFile:sourceView_.file];
+  if (line != NSNotFound)
+    [sourceView_.delegate gutterClickedAtLine:line forFile:sourceView_.file];
 }
 
 // Private /////////////////////////////////////////////////////////////////////