From 7453c71c005671f729e26f2bbeeb750d32c88718 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 5 Nov 2016 10:34:25 -0400 Subject: irc2sql: fix crash on shutdown with no sql --- modules/extra/stats/irc2sql/irc2sql.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/extra/stats/irc2sql/irc2sql.cpp') diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp index 99fb46da3..7baa191f5 100644 --- a/modules/extra/stats/irc2sql/irc2sql.cpp +++ b/modules/extra/stats/irc2sql/irc2sql.cpp @@ -4,7 +4,8 @@ void IRC2SQL::OnShutdown() { // TODO: test if we really have to use blocking query here // (sometimes m_mysql get unloaded before the other thread executed all queries) - SQL::Result r = this->sql->RunQuery(SQL::Query("CALL " + prefix + "OnShutdown()")); + if (this->sql) + SQL::Result r = this->sql->RunQuery(SQL::Query("CALL " + prefix + "OnShutdown()")); quitting = true; } -- cgit