Skip to content

Commit 1a2fb88

Browse files
committed
add relation constructor type check
1 parent 930deaf commit 1a2fb88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/relation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
* </p>
2020
*/
2121
AV.Relation = function(parent, key) {
22+
if (! _.isString(key)) {
23+
throw TypeError('key must be a string');
24+
}
2225
this.parent = parent;
2326
this.key = key;
2427
this.targetClassName = null;

0 commit comments

Comments
 (0)