We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c429475 commit 4d3a96cCopy full SHA for 4d3a96c
storage/src/ios/storage_reference_ios.mm
@@ -147,9 +147,12 @@
147
future_impl->Complete(handle, kErrorUnknown, "Path cannot be empty.");
148
return GetFileLastResult();
149
}
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.
+ NSURL* local_file_url = nil;
+ if ([path_string hasPrefix:@"file://"]) {
+ // 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.
156
local_file_url = [NSURL fileURLWithPath:path_string];
157
158
// If we still failed to convert the path, error out.
0 commit comments