fixed: out of bounds exception when dragging rule editor slices

This commit is contained in:
daboe01 committed 2026-02-19 19:51:34 +01:00
1 parent 192b6ecfc4
commit 3d3674a7d8
1 file changed
+7 -1
+7 -1
View File
@@ -2132,7 +2132,13 @@ TODO: implement
return;
var point = [self convertPoint:[event locationInWindow] fromView:nil],
view = [_slices objectAtIndex:FLOOR(MAX(0, point.y) / _sliceHeight)];
index = FLOOR(MAX(0, point.y) / _sliceHeight);
// Check bounds before accessing the array to prevent CPRangeException
if (index >= [_slices count])
return;
var view = [_slices objectAtIndex:FLOOR(MAX(0, point.y) / _sliceHeight)];
if ([self _dragShouldBeginFromMouseDown:view])
[self _performDragForSlice:view withEvent:event];