From 93d287eb2c5994bef7ed4fa4c8841fecefebdc1c Mon Sep 17 00:00:00 2001 From: NovemLinguae <79697282+NovemLinguae@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:29:09 -0800 Subject: [PATCH] rollback: fix "cannot read properties of undefined" (#2071) hotfix https://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle#Problems_with_WP%3ATwinkle --- twinkle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twinkle.js b/twinkle.js index 59d471ff7..3e36129f9 100644 --- a/twinkle.js +++ b/twinkle.js @@ -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; }