Skip to content
Snippets Groups Projects
Unverified Commit 13206fcf authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix media modal crashing when media has no blurhash (#15229)

parent e7f1439b
No related branches found
No related tags found
No related merge requests found
......@@ -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 () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment