From 034662136fc79abe606188060308aea657d5f91f Mon Sep 17 00:00:00 2001 From: Michal Srutek Date: Wed, 20 Dec 2023 11:29:46 +0100 Subject: [PATCH] Remove force unwrapping from dispose method --- .../InAppBrowserWebViewController.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift index 3f59398b..986f7b93 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift @@ -633,16 +633,16 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega webView?.removeFromSuperview() webView = nil view = nil - if previousStatusBarStyle != -1 { - UIApplication.shared.statusBarStyle = UIStatusBarStyle(rawValue: previousStatusBarStyle)! + if previousStatusBarStyle != -1, let statusBarStyle = UIStatusBarStyle(rawValue: previousStatusBarStyle) { + UIApplication.shared.statusBarStyle = statusBarStyle } transitioningDelegate = nil - searchBar.delegate = nil - closeButton.target = nil - forwardButton.target = nil - backButton.target = nil - reloadButton.target = nil - shareButton.target = nil + searchBar?.delegate = nil + closeButton?.target = nil + forwardButton?.target = nil + backButton?.target = nil + reloadButton?.target = nil + shareButton?.target = nil menuButton?.target = nil plugin = nil }