mirror of
https://github.com/electron/electron.git
synced 2026-01-25 07:18:18 -05:00
Merge pull request #1409 from deepak1556/webcontents_geturl_patch
webContents: fix dereferencing null in getURL
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user