From 82ce13f6f12fa4ca03d17b4f20a7d7dd715f14ef Mon Sep 17 00:00:00 2001 From: Lee Raulin Date: Wed, 9 Jan 2019 15:36:26 -0500 Subject: [PATCH] Fix: Check for urls property of entities Check for urls property to avoid TypeError. --- src/components/Tweet/Text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Tweet/Text.js b/src/components/Tweet/Text.js index ad8b310..f250702 100644 --- a/src/components/Tweet/Text.js +++ b/src/components/Tweet/Text.js @@ -17,7 +17,7 @@ class Text extends React.Component { } // remove any quote links - if (entities && data.quoted_status) { + if (entities && entities.urls && data.quoted_status) { entities.urls.forEach( u => { if (u.expanded_url.indexOf('/status/') > -1) { text = text.replace(u.url, '')