Closed Bug 2034176 Opened 29 days ago Closed 28 days ago

Fix PoliciesUtils to handle missing default/user preference values

Categories

(Firefox Enterprise :: Client, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: janika, Assigned: janika)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [size=1])

Attachments

(1 file)

When a policy changes a default preference, we save the default and user value of the preference when applying the policy and we restore the them when the policy is removed.

The test browser/components/enterprisepolicies/tests/browser/trackingprotection/browser_policy_trackingprotection.js is failing because in saveDefaultPref we call defaults.getStringPref for a preference that has no default preference value.

We should add a fallback when retrieving preference values that potentially don't exist, and only restore the preference when the stored preference value is not null.

Authored by https://github.com/1rneh
https://github.com/mozilla/enterprise-firefox/commit/11acd910851157e4c161e4eb32623217ab1d0f0a
[enterprise-main] Bug 2034176 - Fix PoliciesUtils to handle missing default/user pref values (#769)

Status: NEW → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Blocks: 2019315
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: