mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix media modal crashing when media has no blurhash (#15229)
This commit is contained in:
parent
e7f1439b97
commit
13206fcfb8
@ -221,9 +221,12 @@ class MediaModal extends ImmutablePureComponent {
|
||||
_sendBackgroundColor () {
|
||||
const { media, onChangeBackgroundColor } = this.props;
|
||||
const index = this.getIndex();
|
||||
const backgroundColor = decodeRGB(decode83(media.getIn([index, 'blurhash']).slice(2, 6)));
|
||||
const blurhash = media.getIn([index, 'blurhash']);
|
||||
|
||||
onChangeBackgroundColor(backgroundColor);
|
||||
if (blurhash) {
|
||||
const backgroundColor = decodeRGB(decode83(blurhash.slice(2, 6)));
|
||||
onChangeBackgroundColor(backgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount () {
|
||||
|
Loading…
Reference in New Issue
Block a user