Merge pull request #1409 from deepak1556/webcontents_geturl_patch

webContents: fix dereferencing null in getURL
This commit is contained in:
Cheng Zhao 2015-04-13 17:07:36 +08:00
commit fc7bddf0d9

View file

@ -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();
}