From 9438ba7e10ac9ec35d6357dae6f895df4b5f704e Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Tue, 8 Nov 2016 09:00:00 +0100 Subject: [PATCH] Fix a bug --- app/views/shared/_invite_users_modal.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_invite_users_modal.html.erb b/app/views/shared/_invite_users_modal.html.erb index df478c844..a36a82c73 100644 --- a/app/views/shared/_invite_users_modal.html.erb +++ b/app/views/shared/_invite_users_modal.html.erb @@ -76,7 +76,7 @@ text_invite_heading ||= nil <% if type.in?(['invite_with_org_selector', 'invite_with_org_selector_and_role']) %> <% # Only allow inviting to organizations where user is admin %> - <% uos = current_user.user_organizations.where(role: UserOrganization.roles[:admin]).joins(:organization) %> + <% uos = current_user ? current_user.user_organizations.where(role: UserOrganization.roles[:admin]).joins(:organization) : [] %> <% if uos.count > 0 %>