diff --git a/doric-iOS/Pod/Classes/Shader/DoricListNode.m b/doric-iOS/Pod/Classes/Shader/DoricListNode.m index 9bc12272..2dc675b3 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricListNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricListNode.m @@ -174,7 +174,10 @@ - (void)blendView:(UITableView *)view forPropName:(NSString *)name propValue:(id self.onScrollEndFuncId = prop; } else if ([@"scrolledPosition" isEqualToString:name]) { dispatch_async(dispatch_get_main_queue(), ^{ - [view scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[prop unsignedIntegerValue] inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; + NSUInteger pos = [prop unsignedIntegerValue]; + if (pos < self.rowCount && pos >= 0) { + [view scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:pos inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; + } }); } else if ([@"canDrag" isEqualToString:name]) { bool canDrag = [prop boolValue];