summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-04 10:37:33 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-04 10:37:33 +0000
commit7c7d7b3f8bbadaf1db25cd61e0ddfb5ff2c385a7 (patch)
tree87e0bda2e7f8c96804cf229e0dac3d727ecbe268
parent27d6f7e7cb82be0fe35a899590a1196c7926d403 (diff)
When rehashing by sighup and adding/removing modules, don't attempt to write a user because there isnt one :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3070 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspircd_io.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 66fa0908e..7630eddce 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -417,12 +417,14 @@ void ServerConfig::Read(bool bail, userrec* user)
if (ServerInstance->UnloadModule(removing->c_str()))
{
WriteOpers("*** REHASH UNLOADED MODULE: %s",removing->c_str());
- WriteServ(user->fd,"973 %s %s :Module %s successfully unloaded.",user->nick, removing->c_str(), removing->c_str());
+ if (user)
+ WriteServ(user->fd,"973 %s %s :Module %s successfully unloaded.",user->nick, removing->c_str(), removing->c_str());
rem++;
}
else
{
- WriteServ(user->fd,"972 %s %s :Failed to unload module %s: %s",user->nick, removing->c_str(), removing->c_str(), ServerInstance->ModuleError());
+ if (user)
+ WriteServ(user->fd,"972 %s %s :Failed to unload module %s: %s",user->nick, removing->c_str(), removing->c_str(), ServerInstance->ModuleError());
}
}
if (!added_modules.empty())
@@ -431,12 +433,14 @@ void ServerConfig::Read(bool bail, userrec* user)
if (ServerInstance->LoadModule(adding->c_str()))
{
WriteOpers("*** REHASH LOADED MODULE: %s",adding->c_str());
- WriteServ(user->fd,"975 %s %s :Module %s successfully loaded.",user->nick, adding->c_str(), adding->c_str());
+ if (user)
+ WriteServ(user->fd,"975 %s %s :Module %s successfully loaded.",user->nick, adding->c_str(), adding->c_str());
add++;
}
else
{
- WriteServ(user->fd,"974 %s %s :Failed to load module %s: %s",user->nick, adding->c_str(), adding->c_str(), ServerInstance->ModuleError());
+ if (user)
+ WriteServ(user->fd,"974 %s %s :Failed to load module %s: %s",user->nick, adding->c_str(), adding->c_str(), ServerInstance->ModuleError());
}
}
log(DEFAULT,"Successfully unloaded %lu of %lu modules and loaded %lu of %lu modules.",(unsigned long)rem,(unsigned long)removed_modules.size(),