Skip to content

Commit

Permalink
Check whether the index we are attempting to request data for is valid (
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheshire92 authored and lodicolo committed Mar 28, 2022
1 parent 391ab58 commit 9e57160
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Intersect.Client.Framework/Gwen/ControlInternal/Text.cs
Expand Up @@ -204,7 +204,7 @@ public void SizeToContents()
/// <returns>Character position in local coordinates.</returns>
public Point GetCharacterPosition(int index)
{
if (Length == 0 || index == 0)
if (Length == 0 || index == 0 || index < 0 || index > (TextOverride ?? String).Length)
{
return new Point(0, 0);
}
Expand Down

0 comments on commit 9e57160

Please sign in to comment.