Added nil check
This commit is contained in:
parent
df43cab6bd
commit
57188cfd4f
@ -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")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user