Permalink
Browse files

Fixed issue #17. Issuing a DeleteDocument without an id deletes the d…

…atabase
  • Loading branch information...
1 parent 4444178 commit 56b7af65da1e3bc2e7bad80c77796fbf49781e70 @soitgoes committed Dec 13, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 LoveSeat/CouchDatabase.cs
@@ -62,6 +62,8 @@ public JObject CreateDocument(string jsonForDocument)
}
public JObject DeleteDocument(string id, string rev)
{
+ if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(rev))
+ throw new Exception("Both id and rev must have a value that is not empty");
return GetRequest(databaseBaseUri + "/" + id + "?rev=" + rev).Delete().Form().GetResponse().GetJObject();
}
/// <summary>

0 comments on commit 56b7af6

Please sign in to comment.