mirror of
https://github.com/HackPlan/atom-shell.git
synced 2026-04-25 12:25:50 +08:00
webContents: fix dereferencing null in getURL
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user