From 2b29d1baf3e4dfbc5f2ceafc2e2e3388b6b15452 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 4 Oct 2023 16:34:08 +0200 Subject: [PATCH] Fix some glib nullptr-check warning messages Signed-off-by: Steffen Jaeckel --- src/config/accounts.c | 2 +- src/event/server_events.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config/accounts.c b/src/config/accounts.c index 51a7b9cd..16edc219 100644 --- a/src/config/accounts.c +++ b/src/config/accounts.c @@ -481,7 +481,7 @@ static void _accounts_set_string_option(const char* account_name, const char* const option, const char* const value) { if (accounts_account_exists(account_name)) { - g_key_file_set_string(accounts, account_name, option, value); + g_key_file_set_string(accounts, account_name, option, value ?: ""); _save_accounts(); } } diff --git a/src/event/server_events.c b/src/event/server_events.c index 66ee65a9..1638cc7f 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -300,7 +300,8 @@ sv_ev_room_history(ProfMessage* message) ProfMucWin* mucwin = wins_get_muc(message->from_jid->barejid); if (mucwin) { // if this is the first successful connection - if (ev_is_first_connect()) { + // or for some reason the `last_msg_timestamp` is not initialized + if (ev_is_first_connect() || !mucwin->last_msg_timestamp) { // save timestamp of last received muc message // so we dont display, if there was no activity in channel, once we reconnect if (mucwin->last_msg_timestamp) {