diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 1e924cefa..b77dfe3bd 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -57,25 +57,27 @@ module UsersHelper def get_resource_origin attach type = attach.container_type content = attach.container - case type - when 'Course' - result = current_time_and_term_resource content - when 'Project' - result = content.name - when 'Issue' - result = content.subject - when 'Message' - result = content.subject - when 'News' - result = content.title - when 'HomewCommon' - result = content.name - when 'StudentWorkScore' - result = content.name - when 'Principal' - result = content.name - when 'OrgSubfield' - result = content.name + unless content.nil? + case type + when 'Course' + result = current_time_and_term_resource content + when 'Project' + result = content.name + when 'Issue' + result = content.subject + when 'Message' + result = content.subject + when 'News' + result = content.title + when 'HomewCommon' + result = content.name + when 'StudentWorkScore' + result = content.name + when 'Principal' + result = content.name + when 'OrgSubfield' + result = content.name + end end end