Skip to content

Commit ca27139

Browse files
committed
Added check for eventhandler
1 parent d46f457 commit ca27139

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/firestack.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class Firestack {
6767
})
6868
}
6969

70-
/**
70+
/**
7171
* Wrappers
7272
* We add methods from each wrapper to this instance
7373
* when they are needed. Not sure if this is a good
@@ -108,7 +108,7 @@ export class Firestack {
108108
// return promisify('setStorageUrl')(url);
109109
// }
110110

111-
111+
112112

113113
// other
114114
get ServerValue() {
@@ -173,9 +173,9 @@ export class Firestack {
173173

174174
off(name) {
175175
if (this.eventHandlers[name]) {
176-
this.eventHandlers.forEach(subscription => subscription.remove());
176+
(this.eventHandlers || []).forEach(subscription => subscription.remove());
177177
}
178178
}
179179
}
180180

181-
export default Firestack
181+
export default Firestack

lib/modules/database.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ class DatabaseRef {
225225
if (this.dbFilters.length > 0) {
226226
arr = arr.concat(this.dbFilters);
227227
}
228-
this.dbSort = null; this.dbFilters = []
228+
229+
this.dbSort = null;
230+
this.dbFilters = [];
229231
return arr;
230232
}
231233
}

0 commit comments

Comments
 (0)