Commit 01e6d8ff authored by Xavier Poinas's avatar Xavier Poinas

Fixed a NullReferenceException when merging DynamicParameters

parent ab858e08
......@@ -1978,7 +1978,7 @@ class ParamInfo
/// <summary>
/// construct a dynamic parameter bag
/// </summary>
/// <param name="template">can be an anonymous type of a DynamicParameters bag</param>
/// <param name="template">can be an anonymous type or a DynamicParameters bag</param>
public DynamicParameters(object template)
{
if (template != null)
......@@ -1989,7 +1989,7 @@ public DynamicParameters(object template)
/// <summary>
/// Append a whole object full of params to the dynamic
/// EG: AddParams(new {A = 1, B = 2}) // will add property A and B to the dynamic
/// EG: AddDynamicParams(new {A = 1, B = 2}) // will add property A and B to the dynamic
/// </summary>
/// <param name="param"></param>
public void AddDynamicParams(
......@@ -2023,6 +2023,7 @@ dynamic param
if (subDynamic.templates != null)
{
templates = templates ?? new List<object>();
foreach (var t in subDynamic.templates)
{
templates.Add(t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment