Fix error on empty regex text

This commit is contained in:
Wojciech Figat
2022-03-28 19:57:38 +02:00
parent f10af9d8fb
commit 94fbc28ee0

View File

@@ -551,6 +551,8 @@ namespace FlaxEditor.Windows
if (j == 0)
regexStart += prefixLength;
var regexLength = line.LastCharIndex - regexStart;
if (regexLength > 0)
{
var match = _compileRegex.Match(entryText, regexStart, regexLength);
if (match.Success)
{
@@ -573,6 +575,7 @@ namespace FlaxEditor.Windows
// TODO: parsing hyperlinks with link
// TODO: parsing file paths with link
}
}
prevBlockBottom += line.Size.Y;
_textBlocks.Add(textBlock);