]> khamidou — GitHub mirrors - electron.git/commitdiff
webContents: check for navigation entry before using
authordeepak1556 <hop2deep@gmail.com>
Wed, 29 Apr 2015 03:27:49 +0000 (08:57 +0530)
committerdeepak1556 <hop2deep@gmail.com>
Wed, 29 Apr 2015 03:27:49 +0000 (08:57 +0530)
atom/browser/api/atom_api_web_contents.cc

index 0400e9457e37fade9a511554da1a06c6a050c1dd..d6e0b170ce4db353a940a9c6e4266ae097798708 100644 (file)
@@ -258,7 +258,9 @@ void WebContents::DidNavigateMainFrame(
 
 void WebContents::TitleWasSet(content::NavigationEntry* entry,
                               bool explicit_set) {
-  Emit("page-title-set", entry->GetTitle(), explicit_set);
+  // Back/Forward navigation may have pruned entries.
+  if (entry)
+    Emit("page-title-set", entry->GetTitle(), explicit_set);
 }
 
 void WebContents::DidUpdateFaviconURL(