Merge pull request #1409 from deepak1556/webcontents_geturl_patch
webContents: fix dereferencing null in getURL
This commit is contained in:
commit
fc7bddf0d9
1 changed files with 2 additions and 0 deletions
|
@ -371,6 +371,8 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
|
||||||
|
|
||||||
GURL WebContents::GetURL() const {
|
GURL WebContents::GetURL() const {
|
||||||
auto entry = web_contents()->GetController().GetLastCommittedEntry();
|
auto entry = web_contents()->GetController().GetLastCommittedEntry();
|
||||||
|
if (!entry)
|
||||||
|
return GURL::EmptyGURL();
|
||||||
return entry->GetVirtualURL();
|
return entry->GetVirtualURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue