From c916c63445ab46b060d783181bf41e8b94e8ae27 Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 6 Jan 2008 12:29:31 +0000 Subject: Throw exception if trying to construct a duplicate channel git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8648 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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); -- cgit v1.2.3