diff options
author | vaxerski <[email protected]> | 2022-09-30 21:54:13 +0100 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-09-30 21:54:13 +0100 |
commit | e6c9e3f81dda723e289fa31883b326c086979c7d (patch) | |
tree | b85d5823d88822d0ed6369463e63dcce4d90c11d | |
parent | 7579e03b64261abb592eabaa1c05617628e07492 (diff) | |
download | Hyprland-e6c9e3f81dda723e289fa31883b326c086979c7d.tar.gz Hyprland-e6c9e3f81dda723e289fa31883b326c086979c7d.zip |
add case for empty strings in isNumber
-rw-r--r-- | src/helpers/MiscFunctions.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |