You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/05/23 06:32:16 UTC

[08/10] incubator-weex git commit: * [ios] add error log about out of range error

* [ios] add error log about out of range error


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6806fed0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6806fed0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6806fed0

Branch: refs/heads/0.13-dev
Commit: 6806fed03a3fc783119d11ea04f6c61a352d297b
Parents: 3a972c8
Author: acton393 <zh...@gmail.com>
Authored: Tue May 23 11:46:13 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue May 23 11:46:13 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 2 ++
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m         | 1 +
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6806fed0/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index 8eb6aa9..dc23bf4 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -481,6 +481,7 @@
     NSIndexPath *fromIndexPath = [self indexPathForCell:cell sections:_sections];
     NSIndexPath *toIndexPath = [self indexPathForSubIndex:index];
     if (toIndexPath.row > [_sections[toIndexPath.section].rows count] || toIndexPath.row < 0) {
+        WXLogError(@"toIndexPath %@ is out of range as the current is %d",toIndexPath ,[_sections[toIndexPath.section].rows count]);
         return;
     }
     [self removeCellForIndexPath:fromIndexPath withSections:_sections];
@@ -717,6 +718,7 @@
 {
     WXSection *section = [sections wx_safeObjectAtIndex:indexPath.section];
     if (indexPath.row > [section.rows count] || indexPath.row < 0) {
+        WXLogError(@"inserting cell at indexPath:%@ outof range, sections:%@", indexPath, sections);
         return;
     }
     WXAssert(section, @"inserting cell at indexPath:%@ section has not been inserted to list before, sections:%@", indexPath, sections);

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6806fed0/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
index 6fc6c73..ee80c72 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
@@ -338,6 +338,7 @@
 {
     WXAssert(subcomponent, @"The subcomponent to insert to %@ at index %d must not be nil", self, index);
     if (index > [_subcomponents count]) {
+        WXLogError(@"the index of inserted %ld is out of range as the current is %ld", index, [_subcomponents count]);
         return;
     }