]> 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 10:58:17 +0000 (12:58 +0200)
committerThibaut Girka <thib@sitedethib.com>
Wed, 8 Jul 2020 13:26:02 +0000 (15:26 +0200)
Port d308a863fbd373b94fa571103ad431782c29e074 to glitch-soc

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

index b4db62f4a9a4ae435e28e472537c79ebf0543be0..ab6398e1a553bef3ea53d5eb20d52818f5489aa0 100644 (file)
@@ -86,7 +86,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();
     }
   }