fix(updater): handle null and non-object prefs in appUpdatesEnabled - #1828
fix(updater): handle null and non-object prefs in appUpdatesEnabled#1828hsusul wants to merge 1 commit into
Conversation
|
Thank you @hsusul — tidy PR and a thorough verification list, as always. Closing this along with #1827: both call sites ( There's also a behavioral reason we'd keep the throw: this helper enforces the #1605 contract ("only an explicit false disables update checks"). If pref state were ever corrupted to null, silently returning Appreciate you poking at the updater gating — thanks again! |
Fixes #1827
Problem
In
src/helpers/updateCheckPolicy.js:appUpdatesEnabled({ notificationsEnabled, notifyUpdates } = {})threwTypeError: Cannot destructure property 'notificationsEnabled' of 'null' as it is nullwhen passednull.Solution
nulland non-object values before destructuring.test/helpers/updateCheckPolicy.test.js.Verification
node --test test/helpers/updateCheckPolicy.test.js(passes, 3/3 tests)npm run typecheck(passes, 0 errors)npm run lint(passes, 0 errors)npm run i18n:check(passes)npm run build:renderer(passes)git diff --check(clean)