From e6c9e3f81dda723e289fa31883b326c086979c7d Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 30 Sep 2022 21:54:13 +0100 Subject: [PATCH] add case for empty strings in isNumber --- src/helpers/MiscFunctions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 17e7a1a1..22afd4a0 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -174,6 +174,9 @@ bool isNumber(const std::string& str, bool allowfloat) { std::string copy = str; if (*copy.begin() == '-') copy = copy.substr(1); + + if (copy.empty()) + return false; bool point = !allowfloat; for (auto& c : copy) {