diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 0e228034a6..e0c433695e 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -371,6 +371,8 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) { GURL WebContents::GetURL() const { auto entry = web_contents()->GetController().GetLastCommittedEntry(); + if (!entry) + return GURL::EmptyGURL(); return entry->GetVirtualURL(); }