true anon posts have no user

This commit is contained in:
byte[] 2019-11-11 12:28:43 -05:00
parent da1237a32a
commit 9679897930

View file

@ -17,7 +17,9 @@ defmodule PhilomenaWeb.UserAttributionView do
end
def user_avatar(object, class \\ "avatar--100px") do
if object.user.avatar do
user = object.user
if user and user.avatar do
img_tag(avatar_url_root() <> object.user.avatar, class: class)
else
anonymous_avatar(object, class)