Skip to content

Cannot read properties of null (reading 'length') #1111

@sergey-shpak

Description

@sergey-shpak

Hey, when stopping the app by dispatching null, the following error is thrown:
"Cannot read properties of null (reading 'length')".

It looks like the issue is caused by the following code:

if ((state = newState) == null) dispatch = subscriptions = render = id
if (subscriptions) subs = patchSubs(subs, subscriptions(state), dispatch)

When null is dispatched, the subscriptions variable becomes a reference to (a) => a.
As a result, it returns null when called with patchSubs(subs, subscriptions(state), dispatch) instead of an array (which is causing the issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions