]> cat aescling's git repositories - mastodon.git/commitdiff
Fix WebUI crash on sensitive preview card with no preview thumbnail (#14261)
authorThibG <thib@sitedethib.com>
Wed, 8 Jul 2020 10:58:17 +0000 (12:58 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2020 10:58:17 +0000 (12:58 +0200)
Follow-up on #14260 which only fixed half the call sites

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

index 0a84e481a71afc6086e2e165db6b4d6b1e7f990e..971682df8be0d512a3c8c42074638c9b4ab9f706 100644 (file)
@@ -94,7 +94,7 @@ export default class Card extends React.PureComponent {
   componentDidMount () {
     window.addEventListener('resize', this.handleResize, { passive: true });
 
-    if (this.props.card && this.props.card.get('blurhash')) {
+    if (this.props.card && this.props.card.get('blurhash') && this.canvas) {
       this._decode();
     }
   }