Skip to content

Commit 2e09d37

Browse files
davecoffinHristo Hristov
authored andcommitted
FIX: Now checking that webView.request.URL is not null before accessing properties on it. (NativeScript#4830)
- The symptom is the app would crash when web view tries to load certain (valid) requests.
1 parent d3a6a3f commit 2e09d37

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tns-core-modules/ui/web-view/web-view.ios.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ class UIWebViewDelegateImpl extends NSObject implements UIWebViewDelegate {
5858
traceWrite("UIWebViewDelegateClass.webViewDidFinishLoad(" + webView.request.URL + ")", traceCategories.Debug);
5959
}
6060
let owner = this._owner.get();
61+
6162
if (owner) {
62-
owner._onLoadFinished(webView.request.URL.absoluteString);
63+
let src = owner.src;
64+
if (webView.request && webView.request.URL) {
65+
src = webView.request.URL.absoluteString;
66+
}
67+
owner._onLoadFinished(src);
6368
}
6469
}
6570

0 commit comments

Comments
 (0)