Fix NPE in debug log uploader.

pull/1/head
Matthew Chen 7 years ago
parent b4fc0cddcd
commit c1879250d8

@ -126,9 +126,9 @@ typedef void (^DebugLogUploadFailure)(DebugLogUploader *uploader, NSError *error
// Add a file extension to the upload's key. // Add a file extension to the upload's key.
NSString *fileExtension = strongSelf.fileUrl.lastPathComponent.pathExtension; NSString *fileExtension = strongSelf.fileUrl.lastPathComponent.pathExtension;
if (fileExtension.length < 1) { if (fileExtension.length < 1) {
DDLogError(@"%@ Invalid response: %@, %@", strongSelf.logTag, urlString, responseObject); DDLogError(@"%@ Invalid file url: %@, %@", strongSelf.logTag, urlString, responseObject);
[strongSelf [strongSelf
failWithError:OWSErrorWithCodeDescription(OWSErrorCodeDebugLogUploadFailed, @"Invalid response")]; failWithError:OWSErrorWithCodeDescription(OWSErrorCodeDebugLogUploadFailed, @"Invalid file url")];
return; return;
} }
uploadKey = [uploadKey stringByAppendingPathExtension:fileExtension]; uploadKey = [uploadKey stringByAppendingPathExtension:fileExtension];

Loading…
Cancel
Save