From eea9343393614f81169eaf9ac1fcab1db949d018 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 2 Dec 2012 19:40:33 +0100 Subject: Throw an exception when attempting to register an extension with a name that already exists Previously this silently failed --- src/modules.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/modules.cpp') 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(&item)); + if (!ServerInstance->Extensions.Register(static_cast(&item))) + throw ModuleException("Extension " + std::string(item.name) + " already exists."); return; case SERVICE_DATA: case SERVICE_IOHOOK: -- cgit v1.3.1-10-gc9f91