From: Cheng Zhao Date: Mon, 17 Feb 2014 06:56:23 +0000 (+0800) Subject: Fix crash when calling quitAndUpdate without any update. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b932461b4506853b39870c22ea16598dd02b7895;p=electron.git Fix crash when calling quitAndUpdate without any update. --- diff --git a/browser/api/atom_api_auto_updater.cc b/browser/api/atom_api_auto_updater.cc index 69ed1008..b1fe2915 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