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,9 +77,11 @@ class ArticleViewController: UIViewController {
}
deinit {
webView.removeFromSuperview()
ArticleViewControllerWebViewProvider.shared.enqueueWebView(webView)
webView = nil
if webView != nil {
webView.removeFromSuperview()
ArticleViewControllerWebViewProvider.shared.enqueueWebView(webView)
webView = nil
}
}
override func viewDidLoad() {