aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common/qv4stringtoarrayindex_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/common/qv4stringtoarrayindex_p.h')
-rw-r--r--src/qml/common/qv4stringtoarrayindex_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/common/qv4stringtoarrayindex_p.h b/src/qml/common/qv4stringtoarrayindex_p.h
index 61bd988d1e..d4b064f865 100644
--- a/src/qml/common/qv4stringtoarrayindex_p.h
+++ b/src/qml/common/qv4stringtoarrayindex_p.h
@@ -65,6 +65,8 @@ inline uint charToUInt(const char *ch) { return static_cast<unsigned char>(*ch);
template <typename T>
uint stringToArrayIndex(const T *ch, const T *end)
{
+ if (ch == end)
+ return std::numeric_limits<uint>::max();
uint i = charToUInt(ch) - '0';
if (i > 9)
return std::numeric_limits<uint>::max();