]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix WebUI crash on sensitive preview card with no preview thumbnail
authorThibG <thib@sitedethib.com>
Wed, 8 Jul 2020 07:22:23 +0000 (09:22 +0200)
committerThibaut Girka <thib@sitedethib.com>
Wed, 8 Jul 2020 13:25:31 +0000 (15:25 +0200)
Port 258171549120142a6a7dac40f17ecc2087433f4a to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/features/status/components/card.js

index 4b66760628c0f9ce61113c966d779a6a917c3d26..b4db62f4a9a4ae435e28e472537c79ebf0543be0 100644 (file)
@@ -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();
     }
   }