Permalink
Browse files

Fixing possible NRE

  • Loading branch information...
1 parent 6d5d61b commit 3b79693163dbeb5df63a8a1275b2b90966600002 @synhershko committed Jun 13, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 Raven.Abstractions/Json/Linq/RavenJToken.cs
@@ -40,6 +40,11 @@ protected RavenJToken CloneTokenImpl(RavenJToken newObject)
var curObject = writingStack.Pop();
foreach (var current in curReader)
{
+ if (current.Value == null)
+ {
+ curObject.AddForCloning(current.Key, null); // we call this explicitly to support null entries in JArray
+ continue;
+ }
if (current.Value is RavenJValue)
{
curObject.AddForCloning(current.Key, current.Value.CloneToken());

0 comments on commit 3b79693

Please sign in to comment.