Fix TypeError crash when using url of an invalid user

This commit is contained in:
shpuld 2019-01-29 17:38:55 +02:00
parent 4185452b52
commit b042c48fa7

View file

@ -91,7 +91,9 @@ export const getters = {
userById: state => id => userById: state => id =>
state.users.find(user => user.id === id), state.users.find(user => user.id === id),
userByName: state => name => userByName: state => name =>
state.users.find(user => user.screen_name.toLowerCase() === name.toLowerCase()) state.users.find(user => user.screen_name &&
(user.screen_name.toLowerCase() === name.toLowerCase())
)
} }
export const defaultState = { export const defaultState = {