Make sure the web view has been initialized before deallocating it.

This commit is contained in:
Maurice Parker 2019-10-01 03:51:05 -05:00
parent fdfaa7416a
commit 4e6e61842a
1 changed files with 5 additions and 3 deletions

View File

@ -77,10 +77,12 @@ class ArticleViewController: UIViewController {
} }
deinit { deinit {
if webView != nil {
webView.removeFromSuperview() webView.removeFromSuperview()
ArticleViewControllerWebViewProvider.shared.enqueueWebView(webView) ArticleViewControllerWebViewProvider.shared.enqueueWebView(webView)
webView = nil webView = nil
} }
}
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()