diff --git a/lib/modules/database.js b/lib/modules/database.js index b42b9f8..3f5c23e 100644 --- a/lib/modules/database.js +++ b/lib/modules/database.js @@ -215,7 +215,7 @@ class DatabaseRef extends ReferenceBase { const path = this.dbPath(); return this.db.off(path, evt, origCB) .then(({callback, subscriptions}) => { - if (dbSubscriptions[path][evt].length > 0) { + if (dbSubscriptions[path] && dbSubscriptions[path][evt].length > 0) { return subscriptions; }