From 92b997fb78b25f77f228edbb84f8db5c766b0f1b Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Tue, 9 Dec 2014 19:04:12 -0800 Subject: [PATCH] Fixed: crash when dragging the first line of a RuleEditor above the field Any Previously, cappuccino crashed when dragging the first line of a CPRuleEditor above the field any. Now we make sure, we can not drag over this limit. --- AppKit/CPRuleEditor/CPRuleEditor.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPRuleEditor/CPRuleEditor.j b/AppKit/CPRuleEditor/CPRuleEditor.j index a02b8efe7..404c5546e 100644 --- a/AppKit/CPRuleEditor/CPRuleEditor.j +++ b/AppKit/CPRuleEditor/CPRuleEditor.j @@ -2207,7 +2207,7 @@ TODO: implement indexOfDropLine = FLOOR(y / _sliceHeight), numberOfRows = [self numberOfRows]; - if (indexOfDropLine < 0 || indexOfDropLine > numberOfRows || (indexOfDropLine >= [_draggingRows firstIndex] && indexOfDropLine <= [_draggingRows lastIndex] + 1)) + if (indexOfDropLine <= 0 || indexOfDropLine > numberOfRows || (indexOfDropLine >= [_draggingRows firstIndex] && indexOfDropLine <= [_draggingRows lastIndex] + 1)) { if (_subviewIndexOfDropLine !== CPNotFound && indexOfDropLine !== _subviewIndexOfDropLine) [self _clearDropLine];