diff --git a/Sources/Nuke/Tasks/TaskFetchWithPublisher.swift b/Sources/Nuke/Tasks/TaskFetchWithPublisher.swift index b75d7c937..3fe422a6b 100644 --- a/Sources/Nuke/Tasks/TaskFetchWithPublisher.swift +++ b/Sources/Nuke/Tasks/TaskFetchWithPublisher.swift @@ -50,7 +50,10 @@ final class TaskFetchWithPublisher: ImagePipelineTask<(Data, URLResponse?)> { } }) - onCancelled = cancellable.cancel + onCancelled = { + finish() + cancellable.cancel() + } } private func dataTaskDidFinish(_ result: PublisherCompletion) {