Fix crash when passing empty path to addRecentDocument
This commit is contained in:
parent
02e0c169a2
commit
d0962b1a93
1 changed files with 6 additions and 1 deletions
|
@ -19,7 +19,12 @@ void Browser::Focus() {
|
|||
}
|
||||
|
||||
void Browser::AddRecentDocument(const base::FilePath& path) {
|
||||
NSURL* u = [NSURL fileURLWithPath:base::mac::FilePathToNSString(path)];
|
||||
NSString* path_string = base::mac::FilePathToNSString(path);
|
||||
if (!path_string)
|
||||
return;
|
||||
NSURL* u = [NSURL fileURLWithPath:path_string];
|
||||
if (!u)
|
||||
return;
|
||||
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:u];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue