srtucker22 / chatty

A WhatsApp clone with React Native and Apollo (Tutorial)
https://medium.com/@simontucker/building-chatty-a-whatsapp-clone-with-react-native-and-apollo-part-1-setup-68a02f7e11
MIT License
502 stars 110 forks source link

undefined is not an object (evaluating 'action.payload.auth') #29

Closed thienpow closed 6 years ago

thienpow commented 6 years ago

followed the readme to setup. server is able to start. RN app crashed with this error undefined is not an object (evaluating 'action.payload.auth')

srtucker22 commented 6 years ago

thanks for the heads up!

i think just a simple extra guard should do the trick: if(!action.payload || !action.payload.auth || !action.payload.auth.jwt)

i've updated master with the fix

thienpow commented 6 years ago

thanks, it works.