From: Cheng Zhao Date: Wed, 29 Jul 2015 10:26:20 +0000 (+0800) Subject: Check whether entry is null X-Git-Tag: v0.30.2~8 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=643ed27fd4c92c3715dc3df441ad157fc16ad9fd;p=electron.git Check whether entry is null This fixes the crash in #7877. --- diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index c03ab1ac..8bf25dce 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));