Skip to content

Commit d356e4d

Browse files
committed
Fix TypeError when browserStorage isn't et
1 parent 882c939 commit d356e4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/collection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class Collection extends EventEmitter(Object) {
126126
* Models or raw JavaScript objects to be converted to Models, or any
127127
* combination of the two.
128128
*@param {Model[]|Model|Attributes|Attributes[]} models
129-
*@param {Options} options
129+
*@param {Options} [options]
130130
*/
131131
add(models, options) {
132132
return this.set(models, Object.assign({ merge: false }, options, addOptions));
@@ -287,7 +287,7 @@ class Collection extends EventEmitter(Object) {
287287
});
288288
}),
289289
);
290-
await this.browserStorage.clear();
290+
await this.browserStorage?.clear();
291291
this.reset();
292292
}
293293

0 commit comments

Comments
 (0)