Skip to content

Commit 74a039c

Browse files
authored
Merge pull request #99 from proyecto26/98-prevent-ios-crash-when-redirect-url-is-null
Avoid stringifying null redirect url
2 parents 7a87cf6 + 9126c04 commit 74a039c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ in case of vulnerabilities.
3030
### Fixed
3131
- Complete migration to ns8 and fix build issues by [@rigor789](https://github.com/rigor789) ([#92](https://github.com/proyecto26/nativescript-inappbrowser/pull/92)).
3232
- Fix support for `Metadata Filtering` from Android by [@jcassidyav](https://github.com/jcassidyav) ([#93](https://github.com/proyecto26/nativescript-inappbrowser/pull/93)).
33+
- Avoid stringifying null redirect url by [@rmartin48](https://github.com/rmartin48) ([#99](https://github.com/proyecto26/nativescript-inappbrowser/pull/99)).
3334

3435
### Removed
3536
- Remove `QUERY_ALL_PACKAGES` permission by [@edusperoni](https://github.com/edusperoni) ([#87](https://github.com/proyecto26/nativescript-inappbrowser/pull/87)).

src/InAppBrowser.ios.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ function setup() {
219219
if (!this.initializeWebBrowser(resolve, reject)) return;
220220

221221
const url = NSURL.URLWithString(authUrl);
222-
const escapedRedirectURL = NSURL.URLWithString(redirectUrl).scheme;
222+
let escapedRedirectURL: string = null;
223+
if (redirectUrl) {
224+
escapedRedirectURL = NSURL.URLWithString(redirectUrl).scheme;
225+
}
223226
this.authSession = (
224227
Utils.ios.MajorVersion >= 12
225228
? ASWebAuthenticationSession

0 commit comments

Comments
 (0)