mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 01:29:50 +01:00
add case for empty strings in isNumber
This commit is contained in:
parent
7579e03b64
commit
e6c9e3f81d
1 changed files with 3 additions and 0 deletions
|
@ -174,6 +174,9 @@ bool isNumber(const std::string& str, bool allowfloat) {
|
||||||
std::string copy = str;
|
std::string copy = str;
|
||||||
if (*copy.begin() == '-')
|
if (*copy.begin() == '-')
|
||||||
copy = copy.substr(1);
|
copy = copy.substr(1);
|
||||||
|
|
||||||
|
if (copy.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
bool point = !allowfloat;
|
bool point = !allowfloat;
|
||||||
for (auto& c : copy) {
|
for (auto& c : copy) {
|
||||||
|
|
Loading…
Reference in a new issue