Skip to content

Conversation

@zerobias
Copy link
Contributor

@zerobias zerobias commented Apr 7, 2018

Redux briefly checks that observer received in observe function is a valid object and throw TypeError with useful user message if is not.
However, it missed null case, as typeof null === 'object' (well-known js issue) and then failed with the obscure error message Cannot read property 'next' of null. I'm sure that there is no reason to not to show the correct error message in all relevant cases
https://github.com/reactjs/redux/blob/master/src/createStore.js#L237

This PR fixes that inconsistency by throwing TypeError with the same useful message in case of null observer

Note that this PR is not a breaking change in any way

@timdorr
Copy link
Member

timdorr commented Apr 8, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants