diff options
| author | Adam <Adam@anope.org> | 2012-04-23 05:17:02 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-04-23 05:17:02 -0400 |
| commit | 3d84dc91f6a3304e1efd791ee8241b20499b36fc (patch) | |
| tree | 946c86111e82a23d4c596d08184876fa351d57bb /modules | |
| parent | 573e49a7ead331219eb6f0d3ca9cf83e793a5c9c (diff) | |
| parent | b752c3a668e035a75e0989ae85fddc893aec53f9 (diff) | |
Merge branch '1.9' of anope.git.sf.net:/gitroot/anope/anope into 1.9
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/extra/m_chanstats.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/extra/m_chanstats.cpp b/modules/extra/m_chanstats.cpp index 8f6d8ffb6..8aa7e0a6a 100644 --- a/modules/extra/m_chanstats.cpp +++ b/modules/extra/m_chanstats.cpp @@ -63,6 +63,9 @@ class MChanstats : public Module void GetTables() { TableList.clear(); + if (!sql) + return; + SQLResult r = this->sql->RunQuery(this->sql->GetTables()); for (int i = 0; i < r.Rows(); ++i) { @@ -160,8 +163,10 @@ class MChanstats : public Module Anope::string engine = config.ReadValue("chanstats", "engine", "", 0); this->sql = service_reference<SQLProvider>("SQLProvider", engine); - this->CheckTables(); - + if (sql) + this->CheckTables(); + else + Log() << "Chanstats: no database connection to " << engine; } void OnTopicUpdated(Channel *c, User *u, const Anope::string &topic) anope_override { |
