From 654ef60fe653e3d4e560f3bfe3685c82baacf9d5 Mon Sep 17 00:00:00 2001 From: Dimitri Rusin Date: Fri, 19 Jan 2024 17:49:00 +0100 Subject: [PATCH] ignore --- include/ioh/common/factory.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/ioh/common/factory.hpp b/include/ioh/common/factory.hpp index 73f8e744..941360bd 100644 --- a/include/ioh/common/factory.hpp +++ b/include/ioh/common/factory.hpp @@ -136,6 +136,13 @@ namespace ioh::common const auto already_defined = name_map.find(name) != std::end(name_map); + // Check if the name is empty and ignore it if so + if (name.empty()) { + std::cerr << "Ignoring attempt to include an entry with an empty name." << std::endl; + return; // Exit the function early + } + + std::cerr << "Including in factory:" << std::endl; std::cerr << "Name: " << name << std::endl; std::cerr << "ID: " << id << std::endl;