diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/database.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/database.c b/src/database.c index 54005c2b..de1d36fb 100644 --- a/src/database.c +++ b/src/database.c @@ -123,12 +123,20 @@ log_database_init(ProfAccount *account) void log_database_close(void) { - sqlite3_close(g_chatlog_database); - sqlite3_shutdown(); + if (g_chatlog_database) { + sqlite3_close(g_chatlog_database); + sqlite3_shutdown(); + g_chatlog_database = NULL; + } } void log_database_add(ProfMessage *message, gboolean is_muc) { + if (!g_chatlog_database) { + log_debug("log_database_add() called but db is not initialized"); + return; + } + char *err_msg; char *query; |