developit / stockroom

🗃 Offload your store management to a worker easily.
https://stockroom.surge.sh
1.76k stars 57 forks source link

Error when updating state from null to an object. #9

Closed Kanaye closed 6 years ago

Kanaye commented 6 years ago

When updating a states property from a primitiv value (e.g. null) null to an object. The following line tries to access an property on the primitiv value and therefore throws an error. https://github.com/developit/stockroom/blob/0c99699ed38c3cf993e4f08d489da9fa774e5e52/src/util.js#L52 Here an example.

I probably also PR for this one later.

Edit: It's only null because typeof null === 'object'.