3box-comments-react
3box-comments-react copied to clipboard
crashes when currentUser3BoxProfile is cleared
Using "3box-comments-react": "^3.0.1"
This line:
https://github.com/3box/3box-comments-react/blob/37862baca1f7075916a30d7b0fbc8c56c8506b55/src/components/Input.jsx#L179
is triggering this exception:
TypeError: Cannot read property 'image' of null instrument.ts:129 message:"Cannot read property 'image' of null" stack:"TypeError: Cannot read property 'image' of null at Input.render (webpack-internal:///./node_modules/3box-comments-react/lib/components/Input.js:331:58)
STEPS: I'm not sure if I have narrowed this down to the smallest possible conditions.
<ThreeBoxComments
[irrelevant attributes]
box={a 3Box instance}
currentUserAddr={a valid account address}
currentUser3BoxProfile={a valid 3Box user profile}
/>
<ThreeBoxComments
[irrelevant attributes]
box={undefined}
currentUserAddr={undefined}
currentUser3BoxProfile={undefined}
/>
RESULT: crash EXPECT: no crash
Any suggestions about this? It is blocking our (Alchemy) integration of your comments module. Is there a suggested work-around? Thanks!
Hey! Thanks for the detailed report and sorry for the slow response. Seems like this should be an easy fix. Can have a look at it tomorrow.
Great, thanks!
I just published version 3.0.4. Try it out and see if it works!
Will do, thanks!
@oed Still a crash, looks like when currentUserAddr is defined and currentUser3BoxProfile is not:
https://github.com/3box/3box-comments-react/blob/fcb9115193e64b8ecc1de79ba30bed556d4d1eb5/src/components/Input.jsx#L218
@dkent600 please let us know if this is working better with 3.0.5 :)
Working better, but still seeing an issue in a similar scenario, though I haven't had a chance to confirm exactly what is going on:
index.js:33 Uncaught (in promise) TypeError: Cannot read property 'startsWith' of undefined
The exception is coming from here: https://connect.3box.io/v1/index.js