Skip to content

Commit

Permalink
Update List.cs
Browse files Browse the repository at this point in the history
the changes from DynamoDS#15205 require an update here. If the element is not in the list it should return null instead of -1.
  • Loading branch information
denizmaral authored May 30, 2024
1 parent 0b23a2e commit 2b8ec70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Libraries/CoreNodes/List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,13 @@ public static IList SetUnion(IList<object> list1, IList<object> list2)
/// </summary>
/// <param name="list">The list to find the element in.</param>
/// <param name="element">The element whose index is to be returned.</param>
/// <returns name="int">The index of the element in the list. Invalid index -1 will be returned if strict match not found.</returns>
/// <returns name="int">The index of the element in the list. Invalid index null will be returned if strict match not found.</returns>
/// <search>index,indexof</search>
[IsVisibleInDynamoLibrary(true)]
public static int IndexOf(IList list, object element)
{
return list.IndexOf(element);
var index = list.IndexOf(element);
return index < 0 ? null : index;
}

/// <summary>
Expand Down

0 comments on commit 2b8ec70

Please sign in to comment.