Check render frame host before getting context

This commit is contained in:
Kevin Sawicki 2017-02-24 07:49:26 -08:00
parent a62c2f9e2e
commit 6837ec8576

View file

@ -65,7 +65,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
file_info.push_back(info); file_info.push_back(info);
} }
if (!paths.empty()) { if (render_frame_host_ && !paths.empty()) {
auto browser_context = static_cast<atom::AtomBrowserContext*>( auto browser_context = static_cast<atom::AtomBrowserContext*>(
render_frame_host_->GetProcess()->GetBrowserContext()); render_frame_host_->GetProcess()->GetBrowserContext());
browser_context->prefs()->SetFilePath(prefs::kSelectFileLastDirectory, browser_context->prefs()->SetFilePath(prefs::kSelectFileLastDirectory,