From 99e25587b48e8a328db52e9d2d21e7f7951f613b Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Mon, 11 Jan 2010 05:09:46 +0000 Subject: [PATCH] Fix stack trace when inviting non-existing student. Closes #550. --- app/controllers/assignments_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/assignments_controller.rb b/app/controllers/assignments_controller.rb index f38f9fd3b6..4c647cbb09 100644 --- a/app/controllers/assignments_controller.rb +++ b/app/controllers/assignments_controller.rb @@ -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