Skip to content

Commit c429475

Browse files
committed
Update storage_reference_ios.mm
1 parent 5b1d94f commit c429475

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

storage/src/ios/storage_reference_ios.mm

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,9 @@
147147
future_impl->Complete(handle, kErrorUnknown, "Path cannot be empty.");
148148
return GetFileLastResult();
149149
}
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.
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.
156153
local_file_url = [NSURL fileURLWithPath:path_string];
157154
}
158155
// If we still failed to convert the path, error out.

0 commit comments

Comments
 (0)