From 72aeeb2b345308aca6ba50238566dca7451db1a8 Mon Sep 17 00:00:00 2001
From: ThibG <thib@sitedethib.com>
Date: Wed, 8 Jul 2020 09:22:23 +0200
Subject: [PATCH] [Glitch] Fix WebUI crash on sensitive preview card with no
 preview thumbnail

Port ad1b26b4bc11ff9842357a0204cef5eec1fa2fae to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
---
 .../flavours/glitch/features/status/components/card.js          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/javascript/flavours/glitch/features/status/components/card.js b/app/javascript/flavours/glitch/features/status/components/card.js
index 4b66760628..b4db62f4a9 100644
--- a/app/javascript/flavours/glitch/features/status/components/card.js
+++ b/app/javascript/flavours/glitch/features/status/components/card.js
@@ -98,7 +98,7 @@ export default class Card extends React.PureComponent {
   componentDidUpdate (prevProps) {
     const { card } = this.props;
 
-    if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash'))) {
+    if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash')) && this.canvas) {
       this._decode();
     }
   }