Skip to content

appUpdatesEnabled throws TypeError when called with null #1827

Description

@hsusul

Describe the bug

In src/helpers/updateCheckPolicy.js:

appUpdatesEnabled({ notificationsEnabled, notifyUpdates } = {}) has default parameter = {}, which only triggers when the argument is undefined. When called with null or a non-object value, it throws:

TypeError: Cannot destructure property 'notificationsEnabled' of 'null' as it is null.

To Reproduce

  1. Call appUpdatesEnabled(null) -> throws TypeError.

Expected Behavior

appUpdatesEnabled should safely handle null and non-object values, defaulting to true (check-by-default behavior) 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