Fixed not being able to add to Userdata list

This commit is contained in:
Deukhoofd 2019-01-31 14:48:45 +01:00
parent da10ac2f1a
commit 49531b5595
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 6 additions and 9 deletions

View File

@ -85,16 +85,13 @@ namespace Upsilon.BaseTypes.UserData
index--;
if (index > List.Count)
{
if (index == List.Count)
{
List.Add(value.ToCSharpObject());
}
else
{
throw new Exception(
$"Tried adding an item to a list at position {index}, but list is only of length {List.Count}");
}
if (index == List.Count)
{
List.Add(value.ToCSharpObject());
}
else
{