aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-09-30 21:54:13 +0100
committervaxerski <[email protected]>2022-09-30 21:54:13 +0100
commite6c9e3f81dda723e289fa31883b326c086979c7d (patch)
treeb85d5823d88822d0ed6369463e63dcce4d90c11d
parent7579e03b64261abb592eabaa1c05617628e07492 (diff)
downloadHyprland-e6c9e3f81dda723e289fa31883b326c086979c7d.tar.gz
Hyprland-e6c9e3f81dda723e289fa31883b326c086979c7d.zip
add case for empty strings in isNumber
-rw-r--r--src/helpers/MiscFunctions.cpp3
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) {