Do not allow an empty identifier

This commit is contained in:
Gaël Écorchard
2023-03-10 13:10:00 +01:00
parent d27e69bdc9
commit de42289c12

View File

@@ -154,6 +154,8 @@ std::string Base::Tools::addNumber(const std::string& name, unsigned int num, in
std::string Base::Tools::getIdentifier(const std::string& name)
{
if (name.empty())
return "_";
// check for first character whether it's a digit
std::string CleanName = name;
if (!CleanName.empty() && CleanName[0] >= 48 && CleanName[0] <= 57)