react-tweet icon indicating copy to clipboard operation
react-tweet copied to clipboard

TypeError: Cannot read property 'forEach' of undefined

Open lraulin opened this issue 7 years ago • 0 comments

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) {

lraulin avatar Jan 09 '19 19:01 lraulin