You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by zs...@apache.org on 2019/02/20 11:50:46 UTC

[incubator-weex] branch master updated: [iOS] Fix bug that when imagesrc is nil, image loader is still called. (#2145)

This is an automated email from the ASF dual-hosted git repository.

zshshr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 1fea212  [iOS] Fix bug that when imagesrc is nil, image loader is still called. (#2145)
1fea212 is described below

commit 1fea2120c2d743de040f4c07ca06eff21b8d427e
Author: wqyfavor <wq...@gmail.com>
AuthorDate: Wed Feb 20 19:50:37 2019 +0800

    [iOS] Fix bug that when imagesrc is nil, image loader is still called. (#2145)
---
 ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
index b8d1c9d..70500f4 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
@@ -406,6 +406,9 @@ WX_EXPORT_METHOD(@selector(save:))
             [[self imageLoader] setImageViewWithURL:(UIImageView*)self.view url:[NSURL URLWithString:newURL] placeholderImage:nil options:extInfo progress:nil completed:nil];
         }
         newURL = [[self imageSrc] copy];
+        if ([newURL length] == 0) {
+            return;
+        }
         WX_REWRITE_URL([self imageSrc], WXResourceTypeImage, self.weexInstance)
         NSDictionary *userInfo = @{@"imageQuality":@(self.imageQuality), @"imageSharp":@(self.imageSharp),  @"blurRadius":@(self.blurRadius), @"instanceId":[self _safeInstanceId], @"pageURL": self.weexInstance.scriptURL ?: @""};
         [[self imageLoader] setImageViewWithURL:(UIImageView*)self.view url:[NSURL URLWithString:newURL] placeholderImage:nil options:userInfo progress:^(NSInteger receivedSize, NSInteger expectedSize) {