File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
ios/sdk/WeexSDK/Sources/Component/RecycleList Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,9 @@ - (void)scrollTo:(NSString *)virtalElementInfo options:(NSDictionary *)options
383
383
}
384
384
else
385
385
{
386
+ if (virtalElementInfo.length == 0 ) {
387
+ return ;
388
+ }
386
389
position = [self _positionForVirtalElementInfo: virtalElementInfo];
387
390
}
388
391
NSIndexPath *toIndexPath = [NSIndexPath indexPathForItem: position inSection: 0 ];
@@ -408,13 +411,19 @@ - (void)queryElementAll:(NSString *)virtalElementInfo cssSelector:(NSString *)cs
408
411
- (NSString *)_refForVirtalElementInfo : (NSString *)virtalElementInfo
409
412
{
410
413
NSArray *stringArray = [virtalElementInfo componentsSeparatedByString: @" @" ];
411
- return stringArray[0 ];
414
+ if (stringArray.count == 2 ) {
415
+ return stringArray[0 ];
416
+ }
417
+ return nil ;
412
418
}
413
419
414
420
- (NSUInteger )_positionForVirtalElementInfo : (NSString *)virtalElementInfo
415
421
{
416
422
NSArray *stringArray = [virtalElementInfo componentsSeparatedByString: @" @" ];
417
- return [stringArray[1 ] integerValue ];
423
+ if (stringArray.count == 2 ) {
424
+ return [stringArray[1 ] integerValue ];
425
+ }
426
+ return 0 ;
418
427
}
419
428
420
429
- (void )closest : (NSString *)virtalElementInfo cssSelector : (NSString *)cssSelector callback : (WXModuleCallback)callback
You can’t perform that action at this time.
0 commit comments