commit 05a13d32aa41505a7fcc587f3848b326085d0944
parent 0fe98e7e4001f41b2e6d9520dcb5cde1c3e631e6
Author: TheJackiMonster <thejackimonster@gmail.com>
Date: Fri, 12 Aug 2022 04:01:41 +0200
Added more checks to find source of randomly occuring issue
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat:
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/event.c b/src/event.c
@@ -367,7 +367,7 @@ event_update_chats(MESSENGER_Application *app,
context
);
}
- else if (handle)
+ else if ((handle) && (handle->entry_box))
_clear_chat_entry(gtk_widget_get_parent(handle->entry_box), app);
contact_create_info(GNUNET_CHAT_message_get_sender(msg));
diff --git a/src/ui/chat.c b/src/ui/chat.c
@@ -1536,7 +1536,7 @@ ui_chat_add_message(UI_CHAT_Handle *handle,
MESSENGER_Application *app,
UI_MESSAGE_Handle *message)
{
- GNUNET_assert((handle) && (message));
+ GNUNET_assert((handle) && (message) && (message->message_box));
gtk_container_add(
GTK_CONTAINER(handle->messages_listbox),
@@ -1557,7 +1557,7 @@ ui_chat_remove_message(UI_CHAT_Handle *handle,
UNUSED MESSENGER_Application *app,
UI_MESSAGE_Handle *message)
{
- GNUNET_assert((handle) && (message));
+ GNUNET_assert((handle) && (message) && (message->message_box));
handle->messages = g_list_remove(handle->messages, message);
@@ -1590,7 +1590,8 @@ void
ui_chat_remove_file_load(UI_CHAT_Handle *handle,
UI_FILE_LOAD_ENTRY_Handle *file_load)
{
- GNUNET_assert((handle) && (file_load) && (handle == file_load->chat));
+ GNUNET_assert((handle) && (file_load) && (handle == file_load->chat) &&
+ (file_load->entry_box));
handle->loads = g_list_remove(handle->loads, file_load);
diff --git a/src/ui/chat_entry.c b/src/ui/chat_entry.c
@@ -168,6 +168,8 @@ void
ui_chat_entry_dispose(UI_CHAT_ENTRY_Handle *handle,
MESSENGER_Application *app)
{
+ GNUNET_assert((handle) && (handle->entry_box));
+
UI_MESSENGER_Handle *ui = &(app->ui.messenger);
ui->chat_entries = g_list_remove(ui->chat_entries, handle);