From b932461b4506853b39870c22ea16598dd02b7895 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 17 Feb 2014 14:56:23 +0800 Subject: [PATCH] Fix crash when calling quitAndUpdate without any update. --- browser/api/atom_api_auto_updater.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/api/atom_api_auto_updater.cc b/browser/api/atom_api_auto_updater.cc index 69ed10089128..b1fe2915d331 100644 --- a/browser/api/atom_api_auto_updater.cc +++ b/browser/api/atom_api_auto_updater.cc @@ -80,7 +80,11 @@ void AutoUpdater::CheckForUpdates( void AutoUpdater::QuitAndInstall( const v8::FunctionCallbackInfo& args) { AutoUpdater* self = AutoUpdater::Unwrap(args.This()); - self->quit_and_install_.Run(); + + if (!self->quit_and_install_.is_null()) { + self->quit_and_install_.Run(); + self->quit_and_install_.Reset(); + } } // static