Skip to content

Commit

Permalink
Throw InvalidOperationException when type is null
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetrou committed Feb 1, 2025
1 parent 8cecd4d commit 4df7758
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ public ArrayEditor(Type type) : base(type)
/// Gets or sets the data type this collection contains.
/// </summary>
protected override Type CreateCollectionItemType()
=> CollectionType?.GetElementType()!;
{
Type? type = CollectionType.GetElementType();

return type is null ? throw new InvalidOperationException() : type;
}

/// <summary>
/// Gets the items in the array.
Expand Down

0 comments on commit 4df7758

Please sign in to comment.