Skip to content

TypeError: Cannot read property 'forEach' of undefined #40

@lraulin

Description

@lraulin

Apparently the free streaming API sometimes gives me tweets that have an entities prop that doesn't have a urls prop, causing react-tweet to crash my app with TypeError: Cannot read property 'forEach' of undefined because of line 86 in Text.js:

// remove any quote links
if (entities && data.quoted_status) {
          entities.urls.forEach(function(u) {

Simple fix: Change to:
if (entities && entities.urls && data.quoted_status) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions