aboutsummaryrefslogtreecommitdiff
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)
downloadmessenger-gtk-05a13d32aa41505a7fcc587f3848b326085d0944.tar.gz
messenger-gtk-05a13d32aa41505a7fcc587f3848b326085d0944.zip
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,
367 context 367 context
368 ); 368 );
369 } 369 }
370 else if (handle) 370 else if ((handle) && (handle->entry_box))
371 _clear_chat_entry(gtk_widget_get_parent(handle->entry_box), app); 371 _clear_chat_entry(gtk_widget_get_parent(handle->entry_box), app);
372 372
373 contact_create_info(GNUNET_CHAT_message_get_sender(msg)); 373 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,
1536 MESSENGER_Application *app, 1536 MESSENGER_Application *app,
1537 UI_MESSAGE_Handle *message) 1537 UI_MESSAGE_Handle *message)
1538{ 1538{
1539 GNUNET_assert((handle) && (message)); 1539 GNUNET_assert((handle) && (message) && (message->message_box));
1540 1540
1541 gtk_container_add( 1541 gtk_container_add(
1542 GTK_CONTAINER(handle->messages_listbox), 1542 GTK_CONTAINER(handle->messages_listbox),
@@ -1557,7 +1557,7 @@ ui_chat_remove_message(UI_CHAT_Handle *handle,
1557 UNUSED MESSENGER_Application *app, 1557 UNUSED MESSENGER_Application *app,
1558 UI_MESSAGE_Handle *message) 1558 UI_MESSAGE_Handle *message)
1559{ 1559{
1560 GNUNET_assert((handle) && (message)); 1560 GNUNET_assert((handle) && (message) && (message->message_box));
1561 1561
1562 handle->messages = g_list_remove(handle->messages, message); 1562 handle->messages = g_list_remove(handle->messages, message);
1563 1563
@@ -1590,7 +1590,8 @@ void
1590ui_chat_remove_file_load(UI_CHAT_Handle *handle, 1590ui_chat_remove_file_load(UI_CHAT_Handle *handle,
1591 UI_FILE_LOAD_ENTRY_Handle *file_load) 1591 UI_FILE_LOAD_ENTRY_Handle *file_load)
1592{ 1592{
1593 GNUNET_assert((handle) && (file_load) && (handle == file_load->chat)); 1593 GNUNET_assert((handle) && (file_load) && (handle == file_load->chat) &&
1594 (file_load->entry_box));
1594 1595
1595 handle->loads = g_list_remove(handle->loads, file_load); 1596 handle->loads = g_list_remove(handle->loads, file_load);
1596 1597
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
168ui_chat_entry_dispose(UI_CHAT_ENTRY_Handle *handle, 168ui_chat_entry_dispose(UI_CHAT_ENTRY_Handle *handle,
169 MESSENGER_Application *app) 169 MESSENGER_Application *app)
170{ 170{
171 GNUNET_assert((handle) && (handle->entry_box));
172
171 UI_MESSENGER_Handle *ui = &(app->ui.messenger); 173 UI_MESSENGER_Handle *ui = &(app->ui.messenger);
172 174
173 ui->chat_entries = g_list_remove(ui->chat_entries, handle); 175 ui->chat_entries = g_list_remove(ui->chat_entries, handle);