Fix crash when calling quitAndUpdate without any update.

This commit is contained in:
Cheng Zhao 2014-02-17 14:56:23 +08:00
parent 6b3ff63358
commit b932461b45

View file

@ -80,7 +80,11 @@ void AutoUpdater::CheckForUpdates(
void AutoUpdater::QuitAndInstall(
const v8::FunctionCallbackInfo<v8::Value>& args) {
AutoUpdater* self = AutoUpdater::Unwrap<AutoUpdater>(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