From b042c48fa72b16ae4a4f75a353627bbb5f5ddc72 Mon Sep 17 00:00:00 2001 From: shpuld Date: Tue, 29 Jan 2019 17:38:55 +0200 Subject: [PATCH] Fix TypeError crash when using url of an invalid user --- src/modules/users.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/users.js b/src/modules/users.js index 181946b4..dd555f6c 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -91,7 +91,9 @@ export const getters = { userById: state => id => state.users.find(user => user.id === id), 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 = {