Skip to content

resolveDockVisibility throws TypeError when called without arguments or with nullish parameter #1817

Description

@hsusul

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

  1. Call resolveDockVisibility() -> throws TypeError.
  2. Call resolveDockVisibility(null) -> throws TypeError.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions