diff --git a/src/modules/users.js b/src/modules/users.js index cd789f097b..934bfd0b8c 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -81,7 +81,8 @@ export const mutations = { user.friends.push(friend) } }) - user.lastFriendId = last(friends).id + + user.lastFriendId = friends.length ? last(friends).id : last(user.friends).id }, addFollowers (state, { id, followers }) { const user = state.usersObject[id]