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 0400e94..d6e0b17 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(