Do not create chat if there is not current reference

Closes #14427
This commit is contained in:
Cédric Krier committed 2025-12-18 00:44:36 +01:00
1 parent 42ad8ae30b
commit 8e12aa010b
2 files changed
+6 -4

No files matched your search

+5 -3
View File
@@ -1406,9 +1406,11 @@
if (chat.length) {
chat.remove();
} else {
this._chat = new Sao.Chat(this.screen.current_reference);
this._chat.refresh();
this.sidebar_content.append(this._chat.el);
if (this.screen.current_reference) {
this._chat = new Sao.Chat(this.screen.current_reference);
this._chat.refresh();
this.sidebar_content.append(this._chat.el);
}
}
this.update_sidebar();
},
+1 -1
View File
@@ -265,7 +265,7 @@ class Form(TabContent):
button.props.active = True
return
if button.get_active():
if button.get_active() and self.screen.current_reference:
self._chat = Chat(self.screen.current_reference)
self.chat.pack_start(self._chat.widget, True, True, padding=3)
self.chat.show_all()