It's safe to send message to nil.
This commit is contained in:
parent
d4e362ec89
commit
e8594b492e
1 changed files with 6 additions and 5 deletions
|
@ -21,8 +21,11 @@ namespace {
|
||||||
static SQRLUpdater* g_updater = nil;
|
static SQRLUpdater* g_updater = nil;
|
||||||
|
|
||||||
static void RelaunchToInstallUpdate() {
|
static void RelaunchToInstallUpdate() {
|
||||||
if (g_updater != nil)
|
[[g_updater relaunchToInstallUpdate] subscribeError:^(NSError* error) {
|
||||||
[g_updater relaunchToInstallUpdate];
|
AutoUpdaterDelegate* delegate = AutoUpdater::GetDelegate();
|
||||||
|
if (delegate)
|
||||||
|
delegate->OnError(base::SysNSStringToUTF8(error.localizedDescription));
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -67,9 +70,7 @@ void AutoUpdater::SetFeedURL(const std::string& feed) {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AutoUpdater::CheckForUpdates() {
|
void AutoUpdater::CheckForUpdates() {
|
||||||
if (g_updater != nil) {
|
|
||||||
[g_updater.checkForUpdatesCommand execute:nil];
|
[g_updater.checkForUpdatesCommand execute:nil];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace auto_updater
|
} // namespace auto_updater
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue