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; } ///