mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-16 10:30:08 +00:00
Fix issue #28.
This commit is contained in:
parent
f77f63878d
commit
b8afd06b37
@ -585,8 +585,9 @@ static BOOL ASIndexPathsAreSequential(NSIndexPath *first, NSIndexPath *second)
|
||||
{
|
||||
// sanity-check input
|
||||
// TODO this is proof-of-concept-quality, expand validation when fleshing out update / editing support
|
||||
BOOL indexPathsAreValid = ASIndexPathsAreSequential([self indexPathForIndex:_totalNodeCount - 1],
|
||||
[indexPaths firstObject]);
|
||||
NSIndexPath *lastNode = (_totalNodeCount > 0) ? [self indexPathForIndex:_totalNodeCount - 1] : nil;
|
||||
BOOL indexPathsAreValid = ((lastNode && ASIndexPathsAreSequential(lastNode, [indexPaths firstObject])) ||
|
||||
[[indexPaths firstObject] isEqual:[NSIndexPath indexPathForRow:0 inSection:0]]);
|
||||
if (!indexPaths || !indexPaths.count || !indexPathsAreValid) {
|
||||
ASDisplayNodeAssert(NO, @"invalid argument");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user