浏览代码

Ignore empty url

onevcat 10 年之前
父节点
当前提交
5cbd845a5c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Kingfisher/ImageDownloader.swift

+ 2 - 2
Kingfisher/ImageDownloader.swift

@@ -196,8 +196,8 @@ public extension ImageDownloader {
         
         
         self.requestModifier?(request)
         self.requestModifier?(request)
         
         
-        // There is a possiblility that request modifier changed the url to `nil`
-        if request.URL == nil {
+        // There is a possiblility that request modifier changed the url to `nil` or empty.
+        if request.URL == nil || request.URL!.absoluteString.isEmpty {
             completionHandler?(image: nil, error: NSError(domain: KingfisherErrorDomain, code: KingfisherError.InvalidURL.rawValue, userInfo: nil), imageURL: nil, originalData: nil)
             completionHandler?(image: nil, error: NSError(domain: KingfisherErrorDomain, code: KingfisherError.InvalidURL.rawValue, userInfo: nil), imageURL: nil, originalData: nil)
             return
             return
         }
         }