diff options
author | Adam <Adam@anope.org> | 2013-11-12 19:19:21 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-11-12 19:19:21 -0500 |
commit | c9f4c2db1f90cc16bb23ac176cf4a6dbaa621696 (patch) | |
tree | 150a5367c203ad6fd0eb76d96c0adfcf728f2419 | |
parent | d1248d12491375f2496673d9f87842ff8dee9fa4 (diff) |
try/catch cs_access AccessUnserialize just incase, don't crash if ns_ajoin is loaded before the protocol module
-rw-r--r-- | modules/commands/cs_access.cpp | 10 | ||||
-rw-r--r-- | modules/commands/ns_ajoin.cpp | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index e78bac824..91ca8f1d9 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -25,7 +25,7 @@ class AccessChanAccess : public ChanAccess public: int level; - AccessChanAccess(AccessProvider *p) : ChanAccess(p) + AccessChanAccess(AccessProvider *p) : ChanAccess(p), level(0) { } @@ -41,7 +41,13 @@ class AccessChanAccess : public ChanAccess void AccessUnserialize(const Anope::string &data) anope_override { - this->level = convertTo<int>(data); + try + { + this->level = convertTo<int>(data); + } + catch (const ConvertException &) + { + } } bool operator>(const ChanAccess &other) const anope_override diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 2817dd1a6..383f1acac 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -252,7 +252,7 @@ class NSAJoin : public Module ajoinentry_type("AJoinEntry", AJoinEntry::Unserialize) { - if (!IRCD->CanSVSJoin) + if (!IRCD || !IRCD->CanSVSJoin) throw ModuleException("Your IRCd does not support SVSJOIN"); } |