Skip to content

Commit 2c88075

Browse files
authored
Merge pull request #84 from pedro-ribeiro/fix_database_off
fixing NPE after Database#off
2 parents 07aecfb + b451a4c commit 2c88075

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/modules/database.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class DatabaseRef extends ReferenceBase {
215215
const path = this.dbPath();
216216
return this.db.off(path, evt, origCB)
217217
.then(({callback, subscriptions}) => {
218-
if (dbSubscriptions[path][evt].length > 0) {
218+
if (dbSubscriptions[path] && dbSubscriptions[path][evt].length > 0) {
219219
return subscriptions;
220220
}
221221

0 commit comments

Comments
 (0)