From 3151d60c1ecc9462e4c335282ee6c31672f45111 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 3 Nov 2020 21:01:31 +0000 Subject: Only assign NewServices once the duplicate check is done. --- src/modules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 27431e3fb..17804a48e 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -480,12 +480,12 @@ void ModuleManager::LoadAll() { ConfigTag* tag = i->second; std::string name = ExpandModName(tag->getString("name")); - this->NewServices = &servicemap[name]; // Skip modules which are already loaded. if (Modules.find(name) != Modules.end()) continue; + this->NewServices = &servicemap[name]; std::cout << "[" << con_green << "*" << con_reset << "] Loading module:\t" << con_green << name << con_reset << std::endl; if (!this->Load(name, true)) { -- cgit v1.3.1-10-gc9f91 From 6214094a84f33ea80af4dac88dd1b82bd59a0b5c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 10 Nov 2020 23:34:22 +0000 Subject: Skip module tags which don't have a module specified. --- src/modules.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 17804a48e..77e4142b3 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -479,9 +479,13 @@ void ModuleManager::LoadAll() for (ConfigIter i = tags.first; i != tags.second; ++i) { ConfigTag* tag = i->second; - std::string name = ExpandModName(tag->getString("name")); + + const std::string shortname = tag->getString("name"); + if (shortname.empty()) + continue; // Skip malformed module tags. // Skip modules which are already loaded. + const std::string name = ExpandModName(shortname); if (Modules.find(name) != Modules.end()) continue; -- cgit v1.3.1-10-gc9f91