From 47ef66827373f94527bcecd4e61be5aed26e3724 Mon Sep 17 00:00:00 2001 From: Po-Jui Chen Date: Wed, 16 Mar 2022 11:15:33 +0800 Subject: [PATCH] fix takeScreenshot crash --- ios/Classes/InAppWebView/InAppWebView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Classes/InAppWebView/InAppWebView.swift b/ios/Classes/InAppWebView/InAppWebView.swift index f49fcef7..c6cc38d8 100755 --- a/ios/Classes/InAppWebView/InAppWebView.swift +++ b/ios/Classes/InAppWebView/InAppWebView.swift @@ -670,17 +670,17 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi switch with["compressFormat"] as! String { case "JPEG": let quality = Float(with["quality"] as! Int) / 100 - imageData = screenshot.jpegData(compressionQuality: CGFloat(quality))! + imageData = screenshot.jpegData(compressionQuality: CGFloat(quality)) break case "PNG": - imageData = screenshot.pngData()! + imageData = screenshot.pngData() break default: - imageData = screenshot.pngData()! + imageData = screenshot.pngData() } } else { - imageData = screenshot.pngData()! + imageData = screenshot.pngData() } } completionHandler(imageData)