Explorar el Código

Ignore empty url

onevcat hace 10 años
padre
commit
5cbd845a5c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      Kingfisher/ImageDownloader.swift

+ 2 - 2
Kingfisher/ImageDownloader.swift

@@ -196,8 +196,8 @@ public extension ImageDownloader {
         
         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)
             return
         }