فهرست منبع

fixed empty hex bug

formatting
Marcus Paulsson 11 ماه پیش
والد
کامیت
4db07a19d0
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      core/string/ustring.cpp

+ 4 - 0
core/string/ustring.cpp

@@ -5150,6 +5150,10 @@ bool String::is_valid_hex_number(bool p_with_prefix) const {
 		from += 2;
 		from += 2;
 	}
 	}
 
 
+	if (from == len) {
+		return false;
+	}
+
 	for (int i = from; i < len; i++) {
 	for (int i = from; i < len; i++) {
 		char32_t c = operator[](i);
 		char32_t c = operator[](i);
 		if (is_hex_digit(c)) {
 		if (is_hex_digit(c)) {