Skip to content

Commit

Permalink
Add an assertion in childByIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
barijaona committed Aug 6, 2024
1 parent f1801cf commit 24ee441
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Vienna/Sources/Main window/TreeNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ -(TreeNode *)childByName:(NSString *)childName
}

/* childByIndex
* Returns the TreeNode for the child at the specified index offset. (Note that we don't
* assert index here. The objectAtIndex function will take care of that for us.)
* Returns the TreeNode for the child at the specified index offset.
*/
-(TreeNode *)childByIndex:(NSInteger)index
{
NSAssert(index>=0 && index < children.count, @"index beyond limits in childByIndex:");
return children[index];
}

Expand Down

0 comments on commit 24ee441

Please sign in to comment.