]> cat aescling's git repositories - mastodon.git/commitdiff
Fix WebUI crash on sensitive preview card with no preview thumbnail (#14260)
authorThibG <thib@sitedethib.com>
Wed, 8 Jul 2020 07:22:23 +0000 (09:22 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2020 07:22:23 +0000 (09:22 +0200)
Fixes #14257

app/javascript/mastodon/features/status/components/card.js

index 0af7c54e4b54cce1fc399c742a6f0e43d7794ae0..0a84e481a71afc6086e2e165db6b4d6b1e7f990e 100644 (file)
@@ -106,7 +106,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();
     }
   }