Don't force cast scrollY as it might not always be set. Issue #1685

This commit is contained in:
Maurice Parker 2020-01-25 15:36:43 -07:00
parent aa94fbeacf
commit 785775801a
1 changed files with 1 additions and 1 deletions

View File

@ -423,7 +423,7 @@ extension WebViewController: UIScrollViewDelegate {
@objc func scrollPositionDidChange() {
webView?.evaluateJavaScript("window.scrollY") { (scrollY, _) in
self.restoreWindowScrollY = scrollY as! Int
self.restoreWindowScrollY = scrollY as? Int ?? 0
}
}