summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index c69f09107..115afea52 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -20,6 +20,10 @@
Channel::Channel(InspIRCd* Instance, const std::string &name, time_t ts) : ServerInstance(Instance)
{
+ chan_hash::iterator findchan = ServerInstance->chanlist->find(name);
+ if (findchan != Instance->chanlist->end())
+ throw CoreException("Cannot create duplicate channel " + name);
+
(*(ServerInstance->chanlist))[name.c_str()] = this;
strlcpy(this->name, name.c_str(), CHANMAX);
this->created = ts ? ts : ServerInstance->Time(true);