entity_normalizer: safely check screen_name

Prevents a crash on undefined screen name cases.
This commit is contained in:
Matilde Park 2021-04-21 01:40:25 -04:00
parent 8b96ea9377
commit 06d0254cc5

View File

@ -205,7 +205,7 @@ export const parseUser = (data) => {
// Convert punycode to unicode for UI
output.screen_name_ui = output.screen_name
if (output.screen_name.includes('@')) {
if (output.screen_name && output.screen_name.includes('@')) {
const parts = output.screen_name.split('@')
let unicodeDomain = punycode.toUnicode(parts[1])
if (unicodeDomain !== parts[1]) {