]> khamidou — GitHub mirrors - electron.git/commitdiff
webContents: fix dereferencing null in getURL
authorRobo <hop2deep@gmail.com>
Sun, 12 Apr 2015 05:21:05 +0000 (10:51 +0530)
committerRobo <hop2deep@gmail.com>
Sun, 12 Apr 2015 05:21:05 +0000 (10:51 +0530)
atom/browser/api/atom_api_web_contents.cc

index 4c76f5349eb541f77721b8123b6fd4b65f05858f..1713fe9b7ead166b5944b3bf6ba1e3f5bcc6331b 100644 (file)
@@ -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();
 }