From bbafde3a4e24deea1d2ef17aa13324e3927c5e22 Mon Sep 17 00:00:00 2001 From: Martin Murphy Date: Mon, 10 May 2010 10:01:15 +0800 Subject: [PATCH] BugFix When null was emitted for the value it was failing. New behavior assigns null to Rev when _rev cannot be found in the value emitted. --- src/CouchQueryDocument.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CouchQueryDocument.cs b/src/CouchQueryDocument.cs index e14ffef..ae8513f 100644 --- a/src/CouchQueryDocument.cs +++ b/src/CouchQueryDocument.cs @@ -13,7 +13,8 @@ public override void ReadJson(JObject obj) { Id = obj["id"].Value(); Key = obj["key"].Value(); - Rev = (obj["value"].Value())["rev"].Value(); + var tmp = obj["value"]; + Rev = tmp.ToString() == "null" ? null : tmp.Value()["_rev"].Value(); //Rev is null if the value emitted is not doc or does not contain _rev } } } \ No newline at end of file