summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-02-28 10:24:16 -0500
committerenahum <nahumhbl@gmail.com>2017-02-28 12:24:16 -0300
commit0cd34227cc485aa5603b059168a181a0299b6f4a (patch)
tree3dea6af8a76da6f6ddabb31a08b760751f98311a /webapp
parent66c5f7a31c5d0f26d394b94747c17ee55e5d5ce4 (diff)
downloadchat-0cd34227cc485aa5603b059168a181a0299b6f4a.tar.gz
chat-0cd34227cc485aa5603b059168a181a0299b6f4a.tar.bz2
chat-0cd34227cc485aa5603b059168a181a0299b6f4a.zip
Fix JS error from some link previews (#5556)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/components/post_attachment_opengraph.jsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/webapp/components/post_view/components/post_attachment_opengraph.jsx b/webapp/components/post_view/components/post_attachment_opengraph.jsx
index 20beaed51..b83150839 100644
--- a/webapp/components/post_view/components/post_attachment_opengraph.jsx
+++ b/webapp/components/post_view/components/post_attachment_opengraph.jsx
@@ -81,6 +81,10 @@ export default class PostAttachmentOpenGraph extends React.Component {
}
getBestImageUrl() {
+ if (this.state.data.images == null) {
+ return null;
+ }
+
const nearestPointData = CommonUtils.getNearestPoint(this.imageDimentions, this.state.data.images, 'width', 'height');
const bestImage = nearestPointData.nearestPoint;