webContents: fix dereferencing null in getURL

This commit is contained in:
Robo 2015-04-12 10:51:05 +05:30
parent 252ac465c5
commit 847ae5abe4

View file

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