mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-16 18:40:05 +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
|
// sanity-check input
|
||||||
// TODO this is proof-of-concept-quality, expand validation when fleshing out update / editing support
|
// TODO this is proof-of-concept-quality, expand validation when fleshing out update / editing support
|
||||||
BOOL indexPathsAreValid = ASIndexPathsAreSequential([self indexPathForIndex:_totalNodeCount - 1],
|
NSIndexPath *lastNode = (_totalNodeCount > 0) ? [self indexPathForIndex:_totalNodeCount - 1] : nil;
|
||||||
[indexPaths firstObject]);
|
BOOL indexPathsAreValid = ((lastNode && ASIndexPathsAreSequential(lastNode, [indexPaths firstObject])) ||
|
||||||
|
[[indexPaths firstObject] isEqual:[NSIndexPath indexPathForRow:0 inSection:0]]);
|
||||||
if (!indexPaths || !indexPaths.count || !indexPathsAreValid) {
|
if (!indexPaths || !indexPaths.count || !indexPathsAreValid) {
|
||||||
ASDisplayNodeAssert(NO, @"invalid argument");
|
ASDisplayNodeAssert(NO, @"invalid argument");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user