]> khamidou — GitHub mirrors - electron.git/commitdiff
Check whether entry is null
authorCheng Zhao <zcbenz@gmail.com>
Wed, 29 Jul 2015 10:26:20 +0000 (18:26 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 29 Jul 2015 10:26:20 +0000 (18:26 +0800)
This fixes the crash in #7877.

atom/browser/native_window.cc

index c03ab1ac24a42fc17cea78fb84860ca70be0ee9c..8bf25dce9e3fb35c62437e8342e92f5b2bd5974c 100644 (file)
@@ -549,7 +549,7 @@ void NativeWindow::BeforeUnloadDialogCancelled() {
 void NativeWindow::TitleWasSet(content::NavigationEntry* entry,
                                bool explicit_set) {
   bool prevent_default = false;
-  std::string text = base::UTF16ToUTF8(entry->GetTitle());
+  std::string text = entry ? base::UTF16ToUTF8(entry->GetTitle()) : "";
   FOR_EACH_OBSERVER(NativeWindowObserver,
                     observers_,
                     OnPageTitleUpdated(&prevent_default, text));