Fix issue with trying to match() on undefined

This commit is contained in:
Shpuld Shpuldson 2017-08-18 12:38:47 +03:00
parent 052befa581
commit 1136db24cc

View file

@ -97,7 +97,8 @@ export const statusType = (status) => {
return 'retweet'
}
if ((typeof status.uri === 'string' && status.uri.match(/(fave|objectType=Favourite)/)) || status.text.match(/favorited/)) {
if ((typeof status.uri === 'string' && status.uri.match(/(fave|objectType=Favourite)/)) ||
(typeof status.text === 'string' && status.text.match(/favorited/))) {
return 'favorite'
}