Commit 5f5aa708 authored by Sam's avatar Sam

Merge pull request #33 from xps/master

Fixed a NullReferenceException when merging DynamicParameters
parents d7443490 01e6d8ff
...@@ -1967,7 +1967,7 @@ class ParamInfo ...@@ -1967,7 +1967,7 @@ class ParamInfo
/// <summary> /// <summary>
/// construct a dynamic parameter bag /// construct a dynamic parameter bag
/// </summary> /// </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) public DynamicParameters(object template)
{ {
AddDynamicParams(template); AddDynamicParams(template);
...@@ -1975,7 +1975,7 @@ public DynamicParameters(object template) ...@@ -1975,7 +1975,7 @@ public DynamicParameters(object template)
/// <summary> /// <summary>
/// Append a whole object full of params to the dynamic /// 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> /// </summary>
/// <param name="param"></param> /// <param name="param"></param>
public void AddDynamicParams( public void AddDynamicParams(
...@@ -2022,6 +2022,7 @@ dynamic param ...@@ -2022,6 +2022,7 @@ dynamic param
if (subDynamic.templates != null) if (subDynamic.templates != null)
{ {
templates = templates ?? new List<object>();
foreach (var t in subDynamic.templates) foreach (var t in subDynamic.templates)
{ {
templates.Add(t); 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