From 4db07a19d0abc5c87ea157b0998f6effde5b1b00 Mon Sep 17 00:00:00 2001 From: Marcus Paulsson Date: Mon, 11 Nov 2024 09:51:55 +0100 Subject: [PATCH] fixed empty hex bug formatting --- core/string/ustring.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 521dfe0b8ca..8b5a7161ca3 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -5150,6 +5150,10 @@ bool String::is_valid_hex_number(bool p_with_prefix) const { from += 2; } + if (from == len) { + return false; + } + for (int i = from; i < len; i++) { char32_t c = operator[](i); if (is_hex_digit(c)) {