Merge branch 'fix/user-by-name-type-error' into 'develop'

Fix TypeError crash when using url of an invalid user

See merge request pleroma/pleroma-fe!493
This commit is contained in:
lambda 2019-01-29 15:56:27 +00:00
commit 0e5fe7504f

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 = {