Skip to content
Snippets Groups Projects
Commit 9e0973d6 authored by Alexandre Peres Arias's avatar Alexandre Peres Arias
Browse files

fix when roles is nil

parent 0c7e8a74
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,9 @@ class Management::UsersController < ManagementController
@curators = Array.new
@users = User.includes(:roles).all
@users.all.each do |user|
@curators << user if user.roles[0].name == "curator"
if !user.roles[0].nil?
@curators << user if user.roles[0].name == "curator" || []
end
end
end
......@@ -84,7 +86,9 @@ class Management::UsersController < ManagementController
@admins = Array.new
@users = User.includes(:roles).all
@users.all.each do |user|
@admins << user if user.roles[0].name == "admin"
if !user.roles[0].nil?
@admins << user if user.roles[0].name == "admin" || []
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment