Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

crashes when currentUser3BoxProfile is cleared #34

Open
dkent600 opened this issue May 26, 2020 · 8 comments
Open

crashes when currentUser3BoxProfile is cleared #34

dkent600 opened this issue May 26, 2020 · 8 comments

Comments

@dkent600
Copy link

dkent600 commented May 26, 2020

Using "3box-comments-react": "^3.0.1"

This line:

const updatedProfilePicture = currentUser3BoxProfile.image ? `https://ipfs.infura.io/ipfs/${currentUser3BoxProfile.image[0].contentUrl['/']}`

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

@dkent600
Copy link
Author

dkent600 commented Jun 8, 2020

Any suggestions about this? It is blocking our (Alchemy) integration of your comments module. Is there a suggested work-around? Thanks!

@oed
Copy link
Member

oed commented Jun 8, 2020

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.

@dkent600
Copy link
Author

dkent600 commented Jun 8, 2020

Great, thanks!

@oed
Copy link
Member

oed commented Jun 9, 2020

I just published version 3.0.4. Try it out and see if it works!

@dkent600
Copy link
Author

dkent600 commented Jun 9, 2020

Will do, thanks!

@dkent600
Copy link
Author

dkent600 commented Jun 17, 2020

@oed Still a crash, looks like when currentUserAddr is defined and currentUser3BoxProfile is not:

{currentUserAddr ? `Commenting as ${currentUser3BoxProfile.name || shortenEthAddr(currentUserAddr)}` : ''}

@oed
Copy link
Member

oed commented Jun 18, 2020

@dkent600 please let us know if this is working better with 3.0.5 :)

@dkent600
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants