Fix crash when using file chooser in BrowserView
The crash was a segfault caused by a null `WebDialogHelper::window_`.
This commit is contained in:
parent
3abeb6e2bc
commit
eb19562316
6 changed files with 36 additions and 6 deletions
|
@ -195,6 +195,10 @@ void WebDialogHelper::RunFileChooser(
|
|||
|
||||
AtomBrowserContext* browser_context = static_cast<AtomBrowserContext*>(
|
||||
window_->web_contents()->GetBrowserContext());
|
||||
if (!browser_context) {
|
||||
browser_context = static_cast<atom::AtomBrowserContext*>(
|
||||
render_frame_host->GetProcess()->GetBrowserContext());
|
||||
}
|
||||
settings.default_path = browser_context->prefs()->GetFilePath(
|
||||
prefs::kSelectFileLastDirectory).Append(params.default_file_name);
|
||||
settings.properties = flags;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue