From b8b02ca8455a8add885fba2f2704618a979286f4 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 3 Oct 2012 21:45:04 +0200 Subject: [PATCH] Fixed runtime error if no signature is defined for group. --- app/controllers/tickets_controller.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 5e76a0e0d..f7ba7ab79 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -268,16 +268,19 @@ class TicketsController < ApplicationController log_view( ticket ) # get signature - signature = ticket.group.signature.attributes + signature = {} + if ticket.group.signature + signature = ticket.group.signature.attributes - # replace tags - signature['body'] = NotificationFactory.build( - :string => signature['body'], - :objects => { - :ticket => ticket, - :user => current_user, - } - ) + # replace tags + signature['body'] = NotificationFactory.build( + :string => signature['body'], + :objects => { + :ticket => ticket, + :user => current_user, + } + ) + end # get related articles ticket = ticket.attributes