Permalink
Browse files

fixed bug when adding the UniqueConstraintAttribute after a class had…

… already been stored in raven
  • Loading branch information...
1 parent 9153cf2 commit 443c9c37549065c28c5fbf89fe8af513b6b88e57 @felipeleusin felipeleusin committed Dec 4, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 Bundles/Raven.Bundles.UniqueConstraints/UniqueConstraintsPutTrigger.cs
@@ -135,7 +135,8 @@ public override void OnPut(string key, RavenJObject document, RavenJObject metad
{
var propName = ((RavenJValue)property).Value.ToString();
- if (oldJson.Value<string>(propName).Equals(document.Value<string>(propName))) continue;
+ var oldValue = oldJson.Value<string>(propName);
+ if (oldValue == null || oldValue.Equals(document.Value<string>(propName))) continue;
// Handle Updates in the constraint since it changed
var prefix = "UniqueConstraints/" + entityName + property + "/";

0 comments on commit 443c9c3

Please sign in to comment.