webContents: fix dereferencing null in getURL
This commit is contained in:
parent
252ac465c5
commit
847ae5abe4
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue