summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-04 11:07:58 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-04 11:07:58 +0000
commit416cc382022d9c41670e7b53390a900ef0ec8c89 (patch)
tree9a59e62ac491feb01837bab8a51bb9e120cf20d3 /src/modules
parent7c7d7b3f8bbadaf1db25cd61e0ddfb5ff2c385a7 (diff)
Stop trying to set an empty swhois if the <type> doesn't specify one
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3071 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_swhois.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp
index a8142030d..000eeb040 100644
--- a/src/modules/m_swhois.cpp
+++ b/src/modules/m_swhois.cpp
@@ -187,16 +187,19 @@ class ModuleSWhois : public Module
{
std::string swhois = Conf->ReadValue("type", "swhois", i);
- if(std::string* old = (std::string*)user->GetExt("swhois"))
+ if(swhois.length())
{
- user->Shrink("swhois");
- delete old;
- }
+ if(std::string* old = (std::string*)user->GetExt("swhois"))
+ {
+ user->Shrink("swhois");
+ delete old;
+ }
- std::string* text = new std::string(swhois);
- user->Extend("swhois", (char*)text);
-
- break;
+ std::string* text = new std::string(swhois);
+ user->Extend("swhois", (char*)text);
+
+ break;
+ }
}
}
}