Fix media modal crashing when media has no blurhash (#15229)
This commit is contained in:
		
							parent
							
								
									77aba785e9
								
							
						
					
					
						commit
						c3d62dcf8a
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		|  | @ -221,9 +221,12 @@ class MediaModal extends ImmutablePureComponent { | ||||||
|   _sendBackgroundColor () { |   _sendBackgroundColor () { | ||||||
|     const { media, onChangeBackgroundColor } = this.props; |     const { media, onChangeBackgroundColor } = this.props; | ||||||
|     const index = this.getIndex(); |     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 () { |   componentWillUnmount () { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue