mirror of
https://github.com/electron/electron.git
synced 2026-02-10 23:25:30 -05:00
Merge pull request #3818 from atom/fix-add-recent-document-crash
Fix crash when passing invalid path to addRecentDocument
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user