Fix crash when checking empty string for valid hex number

This commit is contained in:
Andrii Doroshenko (Xrayez) 2018-12-24 20:06:35 +02:00
parent 10e9221c49
commit c891cf32ca
1 changed files with 4 additions and 1 deletions

View File

@ -3578,9 +3578,12 @@ bool String::is_valid_integer() const {
bool String::is_valid_hex_number(bool p_with_prefix) const {
int from = 0;
int len = length();
if (len == 0)
return false;
int from = 0;
if (len != 1 && (operator[](0) == '+' || operator[](0) == '-'))
from++;