From 49531b5595aaa3fe134bbbdb88081032f95c99ea Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 31 Jan 2019 14:48:45 +0100 Subject: [PATCH] Fixed not being able to add to Userdata list --- Upsilon/BaseTypes/UserData/ListUserData.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Upsilon/BaseTypes/UserData/ListUserData.cs b/Upsilon/BaseTypes/UserData/ListUserData.cs index becd8eb..1543ce4 100644 --- a/Upsilon/BaseTypes/UserData/ListUserData.cs +++ b/Upsilon/BaseTypes/UserData/ListUserData.cs @@ -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 {