From 4dcc82a01aaabdce68db884623cae258ec71b2d3 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 18 Feb 2019 11:46:36 +0100 Subject: [PATCH] Improved error handling if ticket got deleted in the meantime. --- app/models/transaction/slack.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/transaction/slack.rb b/app/models/transaction/slack.rb index b6b716ee8..2770d2199 100644 --- a/app/models/transaction/slack.rb +++ b/app/models/transaction/slack.rb @@ -37,7 +37,9 @@ class Transaction::Slack return if !config return if !config['items'] - ticket = Ticket.find(@item[:object_id]) + ticket = Ticket.find_by(id: @item[:object_id]) + return if !ticket + if @item[:article_id] article = Ticket::Article.find(@item[:article_id])