don't crash if we get passed in a null string

This commit is contained in:
Michael Becker 2019-11-17 14:46:02 -05:00
parent 138c5c03ba
commit 2398a9e087
No known key found for this signature in database
GPG Key ID: 389DFF5D73781A12

View File

@ -32,7 +32,14 @@ namespace UniversalEditor
long offset = 0;
for (int i = 0; i < index; i++)
{
offset += list[i].Length + additionalPadding;
if (list[i] == null)
{
offset += additionalPadding;
}
else
{
offset += list[i].Length + additionalPadding;
}
}
return offset;
}