Skip to content

Commit

Permalink
Don’t call dismissNotification if no notification was displayed.
Browse files Browse the repository at this point in the history
If no update is found and dismissNotification is called with nil an exception is triggered which prevents the update from being aborted. This in turns keeps the Updater process running forever and prevents further update checks from running (when used via launch agent)

[sparkle-project#2]
  • Loading branch information
lukele committed Jan 20, 2021
1 parent 4e5f851 commit a5a72c1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Sparkle/GPGScheduledUpdateDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,17 @@ - (void)didFindValidUpdate {
}

- (void)abortUpdate {
[self dismissNotification:self.updateNotification];
// Bug #2: Updater process never exits preventing a new update check from running.
//
// In case no update is found, `self.updateNotification` is nil and
// a call to dismissNotification will trigger an exception within
// `[NSUserNotificationCenter removeDeliveredNotification:]`.
// Since that exception is not caught, `[super abortUpdate]` which sets the
// `finished` flag of the driver is never called and the updater
// believes forever that the update is still in progress.
if(self.updateNotification) {
[self dismissNotification:self.updateNotification];
}
[super abortUpdate];
}

Expand Down

0 comments on commit a5a72c1

Please sign in to comment.