From 2b8ec70869497e733e619f577d25129f5e6b2c26 Mon Sep 17 00:00:00 2001 From: Deniz <55183821+denizmaral@users.noreply.github.com> Date: Thu, 30 May 2024 15:06:33 +0200 Subject: [PATCH] Update List.cs the changes from #15205 require an update here. If the element is not in the list it should return null instead of -1. --- src/Libraries/CoreNodes/List.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Libraries/CoreNodes/List.cs b/src/Libraries/CoreNodes/List.cs index 4833971c456..f0a9890bdef 100644 --- a/src/Libraries/CoreNodes/List.cs +++ b/src/Libraries/CoreNodes/List.cs @@ -165,12 +165,13 @@ public static IList SetUnion(IList list1, IList list2) /// /// The list to find the element in. /// The element whose index is to be returned. - /// The index of the element in the list. Invalid index -1 will be returned if strict match not found. + /// The index of the element in the list. Invalid index null will be returned if strict match not found. /// index,indexof [IsVisibleInDynamoLibrary(true)] public static int IndexOf(IList list, object element) { - return list.IndexOf(element); + var index = list.IndexOf(element); + return index < 0 ? null : index; } ///