Browse files

Return null if null array is passed to ValueConverter.

  • Loading branch information...
1 parent 93c2f2e commit 1e98fb5e214a371b2a7678525d43181260a4cbb5 @lanwin lanwin committed Sep 28, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 source/MongoDB/Configuration/Mapping/Util/ValueConverter.cs
View
3 source/MongoDB/Configuration/Mapping/Util/ValueConverter.cs
@@ -43,6 +43,9 @@ public static object Convert(object value, Type type)
public static Array ConvertArray(object[] elements, Type type)
{
+ if(elements == null)
+ return null;
+
var array = Array.CreateInstance(type, elements.Length);
for(var i = 0; i < elements.Length; i++)

0 comments on commit 1e98fb5

Please sign in to comment.