Skip to content

Commit 4d3a96c

Browse files
committed
Revert "Update storage_reference_ios.mm"
This reverts commit c429475.
1 parent c429475 commit 4d3a96c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

storage/src/ios/storage_reference_ios.mm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,12 @@
147147
future_impl->Complete(handle, kErrorUnknown, "Path cannot be empty.");
148148
return GetFileLastResult();
149149
}
150-
NSURL* local_file_url = [NSURL URLWithString:path_string];
151-
if (local_file_url == nil) {
152-
// If it failed to load as a URL, try loading it is a path.
150+
NSURL* local_file_url = nil;
151+
if ([path_string hasPrefix:@"file://"]) {
152+
// If it starts with the prefix, load it assuming a URL string.
153+
local_file_url = [NSURL URLWithString:path_string];
154+
} else {
155+
// Otherwise, assume it is a file path.
153156
local_file_url = [NSURL fileURLWithPath:path_string];
154157
}
155158
// If we still failed to convert the path, error out.

0 commit comments

Comments
 (0)