diff options
| author | rr- | 2016-08-02 11:58:56 +0200 |
|---|---|---|
| committer | rr- | 2016-08-02 12:27:02 +0200 |
| commit | 67f803a2f25a5e3f1a117df0d266c4b50c5c2642 (patch) | |
| tree | 35306191828ca14d70b877defc4b33cf9f75754a /client/html/comment.tpl | |
| parent | 688740afa98f65963e8e132ed2aed89eae4d4fa1 (diff) | |
client/general: fix support for deleted users
Diffstat (limited to 'client/html/comment.tpl')
| -rw-r--r-- | client/html/comment.tpl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/html/comment.tpl b/client/html/comment.tpl index 8cae159..c0aa766 100644 --- a/client/html/comment.tpl +++ b/client/html/comment.tpl @@ -1,12 +1,12 @@ <div class='comment'> <div class='avatar'> - <% if (ctx.comment.user.name && ctx.canViewUsers) { %> + <% if (ctx.comment.user && ctx.comment.user.name && ctx.canViewUsers) { %> <a href='/user/<%- encodeURIComponent(ctx.comment.user.name) %>'> <% } %> - <%= ctx.makeThumbnail(ctx.comment.user.avatarUrl) %> + <%= ctx.makeThumbnail(ctx.comment.user ? ctx.comment.user.avatarUrl : null) %> - <% if (ctx.comment.user.name && ctx.canViewUsers) { %> + <% if (ctx.comment.user && ctx.comment.user.name && ctx.canViewUsers) { %> </a> <% } %> </div> @@ -14,13 +14,13 @@ <div class='body'> <header><!-- --><span class='nickname'><!-- - --><% if (ctx.comment.user.name && ctx.canViewUsers) { %><!-- + --><% if (ctx.comment.user && ctx.comment.user.name && ctx.canViewUsers) { %><!-- --><a href='/user/<%- encodeURIComponent(ctx.comment.user.name) %>'><!-- --><% } %><!-- - --><%- ctx.comment.user.name %><!-- + --><%- ctx.comment.user ? ctx.comment.user.name : 'Deleted user' %><!-- - --><% if (ctx.comment.user.name && ctx.canViewUsers) { %><!-- + --><% if (ctx.comment.user && ctx.comment.user.name && ctx.canViewUsers) { %><!-- --></a><!-- --><% } %><!-- --></span><!-- |