summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-12-02 19:40:33 +0100
committerattilamolnar <attilamolnar@hush.com>2012-12-02 19:43:20 +0100
commiteea9343393614f81169eaf9ac1fcab1db949d018 (patch)
treea9c71e85998d0fe532efbe8fdd1f2cd7104cb920 /src/modules.cpp
parentfd20068a0bddf39b7464218997ccff37489608c9 (diff)
Throw an exception when attempting to register an extension with a name that already exists
Previously this silently failed
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 1f135176c..4e4d20c70 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -448,7 +448,8 @@ void ModuleManager::AddService(ServiceProvider& item)
throw ModuleException("Mode "+std::string(item.name)+" already exists.");
return;
case SERVICE_METADATA:
- ServerInstance->Extensions.Register(static_cast<ExtensionItem*>(&item));
+ if (!ServerInstance->Extensions.Register(static_cast<ExtensionItem*>(&item)))
+ throw ModuleException("Extension " + std::string(item.name) + " already exists.");
return;
case SERVICE_DATA:
case SERVICE_IOHOOK: