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

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