From ef71c4b2ec6a36e4498ae30771ded9687d68f3c8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 19 Jun 2013 14:22:13 +0200 Subject: [PATCH] Improved error handling. --- app/models/observer/ticket/article/fillup_from_email.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/observer/ticket/article/fillup_from_email.rb b/app/models/observer/ticket/article/fillup_from_email.rb index de7aca61c..3273120df 100644 --- a/app/models/observer/ticket/article/fillup_from_email.rb +++ b/app/models/observer/ticket/article/fillup_from_email.rb @@ -32,6 +32,9 @@ class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer # set sender email_address = ticket.group.email_address + if !email_address + raise "No email address found for group '#{ticket.group.name}'" + end system_sender = "#{email_address.realname} <#{email_address.email}>" if Setting.get('ticket_define_email_from') == 'AgentNameSystemAddressName' seperator = Setting.get('ticket_define_email_from_seperator')