XF 2.2 Hide post username if member of group

I am trying to hide post username if he is a member of certain user group

The following conditional statement is working in template "post_macros" but with error "Template error: Cannot call method isMemberOf on a non-object (NULL)"

Code:
<xf:if is="$post.User.isMemberOf([x,y,z])">

<xf:macro template="message_macros" name="user_info" arg-user="{$post.User}"
arg-fallbackName="{$post.username}"/>

</xf:if>

I am running medical Q&A forum & need to hide the questioner name.

Thanks
 
Last edited:
Top Bottom