Describe the bug
In src/helpers/dockPolicy.js:
resolveDockVisibility({ platform, controlPanelVisible }) directly destructures its first parameter without defaulting to an empty object. When called with null, undefined, or with no arguments, it throws:
TypeError: Cannot destructure property 'platform' of 'undefined' / 'null'.
To Reproduce
- Call
resolveDockVisibility() -> throws TypeError.
- Call
resolveDockVisibility(null) -> throws TypeError.
- Call
resolveDockVisibility(undefined) -> throws TypeError.
Expected Behavior
resolveDockVisibility should safely handle null, undefined, or missing arguments, returning null off-darwin or when platform is not darwin, without throwing an error.
Describe the bug
In
src/helpers/dockPolicy.js:resolveDockVisibility({ platform, controlPanelVisible })directly destructures its first parameter without defaulting to an empty object. When called withnull,undefined, or with no arguments, it throws:TypeError: Cannot destructure property 'platform' of 'undefined' / 'null'.To Reproduce
resolveDockVisibility()-> throwsTypeError.resolveDockVisibility(null)-> throwsTypeError.resolveDockVisibility(undefined)-> throwsTypeError.Expected Behavior
resolveDockVisibilityshould safely handlenull,undefined, or missing arguments, returningnulloff-darwin or whenplatformis not darwin, without throwing an error.