Skip to content

Commit

Permalink
rollback: fix "cannot read properties of undefined" (wikimedia-gadget…
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae authored Nov 24, 2024
1 parent 3da72fd commit 93d287e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions twinkle.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ Twinkle.getPref = function twinkleGetPref(name) {
}

// Backwards compatibility code because we renamed confirmOnFluff to confirmOnRollback, and confirmOnMobileFluff to confirmOnMobileRollback
if (name === 'confirmOnRollback' && Twinkle.prefs.confirmOnFluff !== undefined) {
if (name === 'confirmOnRollback' && typeof Twinkle.prefs === 'object' && Twinkle.prefs.confirmOnFluff !== undefined) {
return Twinkle.prefs.confirmOnFluff;
} else if (name === 'confirmOnMobileRollback' && Twinkle.prefs.confirmOnMobileFluff !== undefined) {
} else if (name === 'confirmOnMobileRollback' && typeof Twinkle.prefs === 'object' && Twinkle.prefs.confirmOnMobileFluff !== undefined) {
return Twinkle.prefs.confirmOnMobileFluff;
}

Expand Down

0 comments on commit 93d287e

Please sign in to comment.