diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index 6589057c2c6c..6a3481cf0612 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -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]; }