From: Robo Date: Sun, 12 Apr 2015 05:21:05 +0000 (+0530) Subject: webContents: fix dereferencing null in getURL X-Git-Tag: v0.24.0~7^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=847ae5abe4b4403e9905f4232bd25267928c340b;p=electron.git webContents: fix dereferencing null in getURL --- diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 4c76f534..1713fe9b 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -360,6 +360,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(); }