Skip to content

Commit 80133de

Browse files
Fixed error calling length of undefined
1 parent 6ca78a1 commit 80133de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/modules/database.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class DatabaseRef extends ReferenceBase {
232232
const path = this.dbPath();
233233
return this.db.off(path, evt, origCB)
234234
.then(({callback, subscriptions}) => {
235-
if (dbSubscriptions[path] && dbSubscriptions[path][evt].length > 0) {
235+
if (dbSubscriptions[path] && dbSubscriptions[path][evt] && dbSubscriptions[path][evt].length > 0) {
236236
return subscriptions;
237237
}
238238

0 commit comments

Comments
 (0)