From e765dd369ffcaca384cba938d9d82254ab30f534 Mon Sep 17 00:00:00 2001 From: onevcat Date: Wed, 27 Feb 2019 22:05:30 +0900 Subject: [PATCH] Fix warnings for watchOS --- Sources/Extensions/WKInterfaceImage+Kingfisher.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Sources/Extensions/WKInterfaceImage+Kingfisher.swift b/Sources/Extensions/WKInterfaceImage+Kingfisher.swift index 55b44dccd..c6f51c261 100644 --- a/Sources/Extensions/WKInterfaceImage+Kingfisher.swift +++ b/Sources/Extensions/WKInterfaceImage+Kingfisher.swift @@ -80,8 +80,14 @@ extension KingfisherWrapper where Base: WKInterfaceImage { completionHandler: { result in CallbackQueue.mainCurrentOrAsync.execute { guard issuedTaskIdentifier == self.taskIdentifier else { - let error = KingfisherError.imageSettingError( - reason: .notCurrentSourceTask(result: result.value, error: result.error, source: source)) + let reason: KingfisherError.ImageSettingErrorReason + do { + let value = try result.get() + reason = .notCurrentSourceTask(result: value, error: nil, source: source) + } catch { + reason = .notCurrentSourceTask(result: nil, error: error, source: source) + } + let error = KingfisherError.imageSettingError(reason: reason) completionHandler?(.failure(error)) return }