Fixed not being able to add to Userdata list

This commit is contained in:
Deukhoofd committed 2019-01-31 14:48:45 +01:00
1 parent da10ac2f1a
commit 49531b5595
1 file changed
+6 -9
+6 -9
View File
@@ -86,15 +86,12 @@ 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}");
}
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
{