From a7e4212d81bbefd82de71c8e8041e8cadec550da Mon Sep 17 00:00:00 2001 From: Mike <17667690+tinrobot2000@users.noreply.github.com> Date: Fri, 10 May 2024 21:06:35 +0800 Subject: [PATCH] https://github.com/DynamoDS/DynamoWishlist/issues/187 --- src/Libraries/CoreNodes/List.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Libraries/CoreNodes/List.cs b/src/Libraries/CoreNodes/List.cs index 0288c0b7e03..0ca35948502 100644 --- a/src/Libraries/CoreNodes/List.cs +++ b/src/Libraries/CoreNodes/List.cs @@ -625,6 +625,15 @@ public static IList ShiftIndices(IList list, int amount) [IsVisibleInDynamoLibrary(true)] public static object GetItemAtIndex(IList list, int index) { + if (index<0) + { + index = list.Count + index; + } + + if (index >= list.Count || index < 0) + { + throw new IndexOutOfRangeException(); + } return list[index]; }