summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/transaction.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/web/transaction.js b/web/transaction.js
index 7c2101f..5c0488d 100644
--- a/web/transaction.js
+++ b/web/transaction.js
@@ -157,6 +157,9 @@ define(
ensureKeyPresence(name);
var value = data.get(name, true);
+ var empty = newValue === null &&
+ type.isCollection(data.meta);
+ if (newValue === undefined) newValue = null;
var tn = _.isObject(newValue);
var npv = tn ? mpath : newValue;
@@ -186,6 +189,11 @@ define(
}
prevTask.always(function() {
+ if (empty) {
+ def.reject("Value not set");
+ return;
+ }
+
var del = newValue == null;
var options;
@@ -330,7 +338,7 @@ define(
var def = $.Deferred();
var length = data.data.length;
- data.set(name, null).done(function(txnValid) {
+ data.set(name).done(function(txnValid) {
if (type.isTreeNode(data.meta) &&
data.meta.type != "set") {