Skip to content

Commit 037b016

Browse files
Filter out null arguments in constructor
1 parent 038ef55 commit 037b016

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/React.Core/RenderFunctions/ChainedRenderFunctions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Collections.ObjectModel;
3+
using System.Linq;
24
using System.Text;
35

46
namespace React.RenderFunctions
@@ -9,15 +11,15 @@ namespace React.RenderFunctions
911
/// </summary>
1012
public class ChainedRenderFunctions : IRenderFunctions
1113
{
12-
private readonly IRenderFunctions[] _chainedFunctions;
14+
private readonly ReadOnlyCollection<IRenderFunctions> _chainedFunctions;
1315

1416
/// <summary>
1517
/// Constructor. Supports chained calls to multiple render functions by passing in a set of functions that should be called next.
1618
/// </summary>
1719
/// <param name="chainedFunctions">The chained render functions to call</param>
1820
public ChainedRenderFunctions(params IRenderFunctions[] chainedFunctions)
1921
{
20-
_chainedFunctions = chainedFunctions;
22+
_chainedFunctions = chainedFunctions.Where(x => x != null).ToList().AsReadOnly();
2123
}
2224

2325
/// <summary>

0 commit comments

Comments
 (0)