Skip to content

Commit

Permalink
fix: prevent JS error when embedding
Browse files Browse the repository at this point in the history
this fix is based on ether#4447
  • Loading branch information
Christian Schröder committed Aug 19, 2022
1 parent 4b96ff6 commit ada245a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/static/js/pad_cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ exports.padcookie = new class {
}

getPref(prefName) {
return this.readPrefs_()[prefName];
const prefs = this.readPrefs_();
return prefs ? prefs[prefName] : null;
}

setPref(prefName, value) {
const prefs = this.readPrefs_();
if (!prefs) {
return;
}
prefs[prefName] = value;
this.writePrefs_(prefs);
}
Expand Down

0 comments on commit ada245a

Please sign in to comment.