Repository: incubator-weex
Updated Branches:
  refs/heads/0.16-dev 4ffcc7cc8 -> 45d52c866


* [ios] assert SDKInstance pageName is not nil


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

Branch: refs/heads/0.16-dev
Commit: 78ff9636b07bbbfe06ec3cf3f94a399e211e3dbd
Parents: a54bcb9
Author: acton393 <zhangxing610...@gmail.com>
Authored: Thu Jul 27 16:28:37 2017 +0800
Committer: acton393 <zhangxing610...@gmail.com>
Committed: Thu Jul 27 16:28:37 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 3 ++-
 ios/sdk/WeexSDK/Sources/Utility/WXAssert.h    | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/78ff9636/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m 
b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index c527ae1..2554e71 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -171,10 +171,11 @@ typedef enum : NSUInteger {
         return;
     }
     
-    if (self.pageName && ![self.pageName isEqualToString:@""]) {
+    if (![WXUtility isBlankString:self.pageName]) {
         WXLog(@"Start rendering page:%@", self.pageName);
     } else {
         WXLogWarning(@"WXSDKInstance's pageName should be specified.");
+        WXAssertCondition(![WXUtility isBlankString:_pageName], 
WXSDKInstance.pageName);
     }
     
     WX_MONITOR_INSTANCE_PERF_START(WXPTFirstScreenRender, self);

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/78ff9636/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h 
b/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h
index 9ebba75..70fa29b 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXAssert.h
@@ -41,6 +41,9 @@ do{\
 #define WXAssertParam(name) WXAssert(name, \
 @"the parameter '%s' is required", #name)
 
+#define WXAssertCondition(condition, param) WXAssert(condition, \
+@"the parameter '%s' is required", #param)
+
 /**
  *  @abstract macro for asserting if the handler conforms to the protocol
  */

Reply via email to