Skip to content

Commit 0bf16f1

Browse files
authored
fix(ionassethandler.m): fix startPath is getting null (#463)
If Ionic is used inside a framework file, self.basePath is null and stringToLoad contains the full needed path. Current string concatenation does not respect that case, leading to startPath is null and so index.html is not loaded. Fix this by setting startPath to empty string instead of null if base path is null.
1 parent 9760822 commit 0bf16f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ios/IONAssetHandler.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ - (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)ur
2828
if ([stringToLoad hasPrefix:@"/_app_file_"]) {
2929
startPath = [stringToLoad stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
3030
} else {
31-
startPath = self.basePath;
31+
startPath = self.basePath ? self.basePath : @"";
3232
if ([stringToLoad isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
3333
startPath = [startPath stringByAppendingString:@"/index.html"];
3434
} else {

0 commit comments

Comments
 (0)