]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
Reasonably sized fix - when adding modes in modules, be sure to check the return...
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index 47845054c6f4842ed270cc6195950573c8d6e2b7..b5024e4df1dfa2680ee38bc3811a4e0325fd7127 100644 (file)
@@ -122,9 +122,8 @@ class ModuleServicesAccount : public Module
                m1 = new AChannel_R(ServerInstance);
                m2 = new AChannel_M(ServerInstance);
                m3 = new AUser_R(ServerInstance);
-               ServerInstance->AddMode(m1, 'R');
-               ServerInstance->AddMode(m2, 'M');
-               ServerInstance->AddMode(m3, 'R');
+               if (!ServerInstance->AddMode(m1, 'R') || !ServerInstance->AddMode(m2, 'M') || !ServerInstance->AddMode(m3, 'R'))
+                       throw ModuleException("Could not add new modes!");
        }
 
        /* <- :twisted.oscnet.org 330 w00t2 w00t2 w00t :is logged in as */