Fix requests for deleted users
When users are requested from the authorship which no longer exist, they shouldn't cause a 500. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
@@ -486,11 +486,13 @@ function startConnection (socket) {
|
||||
for (var i = 0; i < note.authors.length; i++) {
|
||||
var author = note.authors[i]
|
||||
var profile = models.User.getProfile(author.user)
|
||||
authors[author.userId] = {
|
||||
userid: author.userId,
|
||||
color: author.color,
|
||||
photo: profile.photo,
|
||||
name: profile.name
|
||||
if (profile) {
|
||||
authors[author.userId] = {
|
||||
userid: author.userId,
|
||||
color: author.color,
|
||||
photo: profile.photo,
|
||||
name: profile.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user