[glitch-port]: Do not crash when hashtag.history is undefined

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-09-14 03:39:28 +02:00
parent 3d453238f4
commit fc0fcd35f2
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE

View file

@ -20,7 +20,7 @@ const Hashtag = ({ hashtag }) => (
</div>
<div className='trends__item__sparkline'>
<Sparklines width={50} height={28} data={hashtag.get('history').reverse().map(day => day.get('uses')).toArray()}>
<Sparklines width={50} height={28} data={hashtag.get('history') && hashtag.get('history').reverse().map(day => day.get('uses')).toArray()}>
<SparklinesCurve style={{ fill: 'none' }} />
</Sparklines>
</div>