[Glitch] Fix WebUI crash on sensitive preview card with no preview thumbnail

Port 258171549120142a6a7dac40f17ecc2087433f4a to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
ThibG 2020-07-08 09:22:23 +02:00 committed by Thibaut Girka
parent de938023ab
commit a513997367

View File

@ -98,7 +98,7 @@ export default class Card extends React.PureComponent {
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
const { card } = this.props; 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(); this._decode();
} }
} }