Skip to content

Commit

Permalink
Fix stack trace when inviting non-existing student. Closes MarkUsProj…
Browse files Browse the repository at this point in the history
  • Loading branch information
Severin Gehwolf authored and Severin Gehwolf committed Jan 11, 2010
1 parent 8fca691 commit 99e2558
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,14 @@ def invite_member
m_logger.log(I18n.t("markus_logger.student_invited_student", :inviter => @student.user_name, :invitee => @invited.user_name))
rescue Exception => e
flash[:fail_notice].push(e.message)
invitee = nil
if !@invited.nil?
invitee = @invited.user_name
else
invitee = user_name
end
m_logger.log(I18n.t('markus_logger.student_invitation_failure',
{ :inviter => @student.user_name, :invitee => @invited.user_name,
{ :inviter => @student.user_name, :invitee => invitee,
:error => e.message }), MarkusLogger::ERROR)
end
end
Expand Down

0 comments on commit 99e2558

Please sign in to comment.