summaryrefslogtreecommitdiff
path: root/modules/extra/stats/irc2sql/irc2sql.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-11-05 10:34:25 -0400
committerAdam <Adam@anope.org>2016-11-05 10:34:25 -0400
commit7453c71c005671f729e26f2bbeeb750d32c88718 (patch)
treeccd79597712bbb34e07e0ad67d2e6d09c0e080f0 /modules/extra/stats/irc2sql/irc2sql.cpp
parentf09ea316dda61a162253b373689c05dfbfd29d6e (diff)
irc2sql: fix crash on shutdown with no sql
Diffstat (limited to 'modules/extra/stats/irc2sql/irc2sql.cpp')
-rw-r--r--modules/extra/stats/irc2sql/irc2sql.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}