diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/chatmessage.cpp | 6 | ||||
-rw-r--r-- | components/chatwindow.cpp | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/components/chatmessage.cpp b/components/chatmessage.cpp index 68d2359..5f95b47 100644 --- a/components/chatmessage.cpp +++ b/components/chatmessage.cpp @@ -143,8 +143,10 @@ void ChatMessageItemContainer::UpdateReactions() { } void ChatMessageItemContainer::SetFailed() { - m_text_component->get_style_context()->remove_class("pending"); - m_text_component->get_style_context()->add_class("failed"); + if (m_text_component != nullptr) { + m_text_component->get_style_context()->remove_class("pending"); + m_text_component->get_style_context()->add_class("failed"); + } } void ChatMessageItemContainer::UpdateAttributes() { diff --git a/components/chatwindow.cpp b/components/chatwindow.cpp index 1a2bb48..55ff06d 100644 --- a/components/chatwindow.cpp +++ b/components/chatwindow.cpp @@ -200,6 +200,9 @@ bool ChatWindow::OnInputSubmit(const Glib::ustring &text) { if (!m_rate_limit_indicator->CanSpeak()) return false; + if (text.size() == 0) + return false; + if (m_active_channel.IsValid()) m_signal_action_chat_submit.emit(text, m_active_channel, m_replying_to); // m_replying_to is checked for invalid in the handler if (m_is_replying) |