From 93c3feeacf090262ee24a8610f451a9196d92581 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 26 Oct 2015 23:11:38 +0000 Subject: [PATCH] Add assert checks for ProfChatWin functions --- src/ui/chatwin.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 9af332a3..3b3d2e1c 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -34,6 +34,7 @@ #include #include +#include #include "chat_session.h" #include "window_list.h" @@ -49,6 +50,8 @@ static void _win_show_history(ProfChatWin *chatwin, const char *const contact); void ui_message_receipt(ProfChatWin *chatwin, const char *const id) { + assert(chatwin != NULL); + ProfWin *win = (ProfWin*) chatwin; win_mark_received(win, id); } @@ -56,6 +59,8 @@ ui_message_receipt(ProfChatWin *chatwin, const char *const id) void ui_gone_secure(ProfChatWin *chatwin, gboolean trusted) { + assert(chatwin != NULL); + chatwin->is_otr = TRUE; chatwin->otr_is_trusted = trusted; @@ -84,6 +89,8 @@ ui_gone_secure(ProfChatWin *chatwin, gboolean trusted) void ui_gone_insecure(ProfChatWin *chatwin) { + assert(chatwin != NULL); + chatwin->is_otr = FALSE; chatwin->otr_is_trusted = FALSE;