From 643ed27fd4c92c3715dc3df441ad157fc16ad9fd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 29 Jul 2015 18:26:20 +0800 Subject: [PATCH] Check whether entry is null This fixes the crash in #7877. --- atom/browser/native_window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index c03ab1ac24a4..8bf25dce9e3f 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -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));