summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-08-12 04:01:41 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2022-08-12 04:01:41 +0200
commit05a13d32aa41505a7fcc587f3848b326085d0944 (patch)
tree3e58575050a5e0bd16033300f79d899f5406d2c4
parent0fe98e7e4001f41b2e6d9520dcb5cde1c3e631e6 (diff)
Added more checks to find source of randomly occuring issue
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--src/event.c2
-rw-r--r--src/ui/chat.c7
-rw-r--r--src/ui/chat_entry.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/src/event.c b/src/event.c
index 80deb25..7956e05 100644
--- 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
index 3ac4847..548a307 100644
--- 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
index 89272be..217a46d 100644
--- 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);