We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73c206e commit a700eaeCopy full SHA for a700eae
src/utils.js
@@ -50,9 +50,13 @@ function getRemovable(db) {
50
_(doc).each(function(value, key) {
51
if (/Id$/.test(key)) {
52
var refName = _.pluralize(key.slice(0, - 2))
53
- var ref = _.findWhere(db[refName], {id: value})
54
- if (_.isUndefined(ref)) {
55
- removable.push({ name: collName, id: doc.id })
+ // Test if table exists
+ if (db[refName]) {
+ // Test if references is defined in table
56
+ var ref = _.findWhere(db[refName], {id: value})
57
+ if (_.isUndefined(ref)) {
58
+ removable.push({ name: collName, id: doc.id })
59
+ }
60
}
61
62
})
0 commit comments