Updated group_serializer to account for no current_user

• Updated:
- group_serializer to account for no current_user
This commit is contained in:
mgabdev 2020-09-14 11:04:42 -05:00
parent b124a5024c
commit 4242f595df

@ -16,7 +16,7 @@ class REST::GroupSerializer < ActiveModel::Serializer
end
def password
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
if current_user && object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
object.password
else
nil