From e503ed6b6ee0d6a2f6b93292336dfa121cd866d2 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Wed, 9 Aug 2017 11:07:29 -0700 Subject: [PATCH] Fix charCodeAt if index is out of range --- lime/text/UTF8String.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lime/text/UTF8String.hx b/lime/text/UTF8String.hx index 211602453..c39c5973b 100644 --- a/lime/text/UTF8String.hx +++ b/lime/text/UTF8String.hx @@ -54,7 +54,8 @@ abstract UTF8String(String) from String to String { **/ public function charCodeAt (index:Int):Null { - return Utf8.charCodeAt (this, index); + if (index < 0 || index >= Unifill.uLength (this)) return null; + return Unifill.uCharCodeAt (this, index); }