Skip to content

Commit

Permalink
Fix initialization for some types of storage
Browse files Browse the repository at this point in the history
  • Loading branch information
modos189 committed Aug 16, 2023
1 parent a17e588 commit 770c66b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class Worker {
} else {
data = await this.storage.get([key]).then((result) => result[key]);
}
if (typeof data === 'undefined') data = defaults;
if (!isSet(data)) data = defaults;

this[key] = data;
await this._save({ [key]: data });
Expand Down

0 comments on commit 770c66b

Please sign in to comment.