mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Escape file paths to avoid crashes when paths include spaces
PiperOrigin-RevId: 438437189
This commit is contained in:
committed by
Copybara-Service
parent
a952c85e49
commit
267afabefd
@@ -147,8 +147,8 @@ void GNCPayloadListener::OnPayload(const std::string &endpoint_id, Payload paylo
|
||||
case PayloadType::kFile:
|
||||
if (handlers.filePayloadHandler) {
|
||||
InputFile *payloadInputFile = payload.AsFile();
|
||||
NSURL *fileURL =
|
||||
[NSURL URLWithString:ObjCStringFromCppString(payloadInputFile->GetFilePath())];
|
||||
NSString *fileString = ObjCStringFromCppString(payloadInputFile->GetFilePath());
|
||||
NSURL *fileURL = [NSURL fileURLWithPath:fileString];
|
||||
int64_t fileSize = payloadInputFile->GetTotalSize();
|
||||
NSProgress *progress = [NSProgress progressWithTotalUnitCount:fileSize];
|
||||
progress.cancellable = YES;
|
||||
|
||||
Reference in New Issue
Block a user