Skip to content

Commit 421e58e

Browse files
authored
focus-new-window@mdpenguin: Fix disconnection try on possibly null signal id values (#649)
1 parent 5bef645 commit 421e58e

File tree

1 file changed

+10
-2
lines changed
  • focus-new-window@mdpenguin/files/focus-new-window@mdpenguin

1 file changed

+10
-2
lines changed

focus-new-window@mdpenguin/files/focus-new-window@mdpenguin/extension.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,16 @@ class SettingsHandler {
1717

1818
class AttentionHandler {
1919
init() {
20-
global.display.disconnect(Main.windowAttentionHandler._windowDemandsAttentionId);
21-
global.display.disconnect(Main.windowAttentionHandler._windowMarkedUrgentId);
20+
if (Main.windowAttentionHandler._windowDemandsAttentionId) {
21+
global.display.disconnect(Main.windowAttentionHandler._windowDemandsAttentionId);
22+
Main.windowAttentionHandler._windowDemandsAttentionId = null;
23+
}
24+
25+
if (Main.windowAttentionHandler._windowMarkedUrgentId) {
26+
global.display.disconnect(Main.windowAttentionHandler._windowMarkedUrgentId);
27+
Main.windowAttentionHandler._windowMarkedUrgentId = null;
28+
}
29+
2230
oldHandler = Main.windowAttentionHandler;
2331

2432
this._windowDemandsAttentionId = global.display.connect('window-demands-attention', this._onWindowDemandsAttention.bind(this));

0 commit comments

Comments
 (0)