From d76a05eddbe3bdf07caea50abf836b6881c2990a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Feb 2023 09:23:35 +0100 Subject: [PATCH] Make the check for whitespaces and dots in identifiers fatal also in non-Debug builds --- src/properties/propertyowner.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 04c828ad7e..3b4e780f42 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -377,15 +377,9 @@ void PropertyOwner::removePropertySubOwner(openspace::properties::PropertyOwner& } void PropertyOwner::setIdentifier(std::string identifier) { - ghoul_precondition( - _identifier.find_first_of("\t\n ") == std::string::npos, - "Identifier must not contain any whitespaces" - ); - ghoul_precondition( - _identifier.find_first_of('.') == std::string::npos, - "Identifier must not contain any dots" - ); - + if (identifier.find_first_of(". \t\n") != std::string::npos) { + throw ghoul::RuntimeError("Identifier must not contain any dots or whitespaces"); + } _identifier = std::move(identifier); }