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

crashes when currentUser3BoxProfile is cleared #34

Description

@dkent600

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions