DTGridView icon indicating copy to clipboard operation
DTGridView copied to clipboard

Crash in removeCellWithInfo

Open quimarche opened this issue 13 years ago • 0 comments

Daniel

Please can you review & comment?

The two "greater than" tests for xPosition and yPosition should surely be "greater than or equal". If, for example info.yPosition = 3 and [gridCells count] = 3 then then next line [gridCells objectAtIndex:info.yPosition] evaluates to [gridCells objectAtIndex:3] and we get a range exception.

Regards

Chris & Murthy

  • (void)removeCellWithInfo:(DTGridViewCellInfo *)info {

    if (info.yPosition > [gridCells count]) return;
    
    NSMutableArray *row = [gridCells objectAtIndex:info.yPosition];
    
    if (info.xPosition > [row count]) return;
    

quimarche avatar Jun 23 '11 16:06 quimarche