Added nil check

This commit is contained in:
Eduard Urbach 2017-11-25 14:31:15 +01:00
parent df43cab6bd
commit 57188cfd4f

View File

@ -43,9 +43,10 @@ component Postable(post arn.Postable, user *arn.User, highlightAuthorID string)
Icon("pencil") Icon("pencil")
if post.Type() != "Thread" if post.Type() != "Thread"
if user.Role == "admin" || user.Role == "editor" if user != nil && (user.Role == "admin" || user.Role == "editor")
a.post-tool.post-delete.action(data-action="deletePost", data-trigger="click", data-id=post.ID(), title="Delete") a.post-tool.post-delete.action(data-action="deletePost", data-trigger="click", data-id=post.ID(), title="Delete")
Icon("trash") Icon("trash")
a.post-tool.post-permalink.ajax(href=post.Link(), title="Permalink") a.post-tool.post-permalink.ajax(href=post.Link(), title="Permalink")
Icon("link") Icon("link")