diff options
author | Florian Bruhin <me@the-compiler.org> | 2022-05-02 15:52:05 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2022-05-02 17:12:47 +0200 |
commit | c987f7804880792b6368cc3853298f9ffd70a836 (patch) | |
tree | f8a906274a95ee937427fb4165c8a434a8d4cce8 | |
parent | bb90ff9dbb0bfb060a526a2dcd3431b062f6dcc3 (diff) | |
download | qutebrowser-c987f7804880792b6368cc3853298f9ffd70a836.tar.gz qutebrowser-c987f7804880792b6368cc3853298f9ffd70a836.zip |
notifications: Make invalid IDs non-fatal
Also only check for them for DBus notifications. Fixes #7153.
(cherry picked from commit 3a09126e2ea8280a0b0635be246eafa27377f5cc)
-rw-r--r-- | qutebrowser/browser/webengine/notification.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qutebrowser/browser/webengine/notification.py b/qutebrowser/browser/webengine/notification.py index 69c702aec..ea52fc790 100644 --- a/qutebrowser/browser/webengine/notification.py +++ b/qutebrowser/browser/webengine/notification.py @@ -276,9 +276,6 @@ class NotificationBridgePresenter(QObject): log.misc.debug("Adapter vanished, bailing out") # type: ignore[unreachable] return - if notification_id <= 0: - raise Error(f"Got invalid notification id {notification_id}") - if replaces_id is None: if notification_id in self._active_notifications: raise Error(f"Got duplicate id {notification_id}") @@ -1004,6 +1001,9 @@ class DBusNotificationAdapter(AbstractNotificationAdapter): else: log.misc.error(msg) + if notification_id <= 0: + self.error.emit(f"Got invalid notification id {notification_id}") + return notification_id def _convert_image(self, qimage: QImage) -> Optional[QDBusArgument]: |