Skip to content

Commit 39949fa

Browse files
committed
fixed validation for reference update op: was missing the either HashedObject or pure javascript literal part!
1 parent e7e00e4 commit 39949fa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/data/collections/mutable/MutableReference.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,17 @@ class RefUpdateOp<T> extends CollectionOp<T> {
190190
}
191191

192192
if (this.value === undefined) {
193-
MutableObject.validationLog.debug('The field value is mandatory in class REfUpdateop');
193+
MutableObject.validationLog.debug('The field value is mandatory in class RefUpdateop');
194194
return false;
195195
}
196196

197+
if (!(this.value instanceof HashedObject)) {
198+
if (!HashedObject.isLiteral(this.value)) {
199+
MutableObject.validationLog.debug('The field value in class RefUpdateop must either be a HashedObject instance or a pure literal (a constant, without any HashedObjects within).');
200+
return false;
201+
}
202+
}
203+
197204
return true;
198205
}
199206

0 commit comments

Comments
 (0)