breakManager: Fix a potential null object dereference
There’s no `else` branch above, so it’s possible for `this._notification` to be `null` at the bottom of the function (especially if the user has explicitly closed the previous notification), so handle that. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
This commit is contained in:
parent
35ead0422c
commit
6131beead6
@ -1278,8 +1278,11 @@ class BreakNotificationSource extends GObject.Object {
|
||||
this._scheduleUpdateState(updateTimeoutSeconds);
|
||||
}
|
||||
|
||||
this._notification.urgency = this._urgencyForBreakType(this._manager.currentBreakType);
|
||||
this._source.addNotification(this._notification);
|
||||
if (this._notification) {
|
||||
this._notification.urgency = this._urgencyForBreakType(this._manager.currentBreakType);
|
||||
this._source.addNotification(this._notification);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user