From f14653857fe1651f2ff2f114a29715a593e73bee Mon Sep 17 00:00:00 2001 From: Andrei Prigorshnev Date: Fri, 27 Aug 2021 16:57:53 +0200 Subject: [PATCH] FIX: Ensure archive_message does not raise error when unassigned --- plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index 36df31c..05ea327 100644 --- a/plugin.rb +++ b/plugin.rb @@ -545,8 +545,8 @@ after_initialize do topic = info[:topic] next if !topic.assignment - assigned_to_id = topic.assignment.assigned_to_id - assigned_to_type = topic.assignment.assigned_to_type + assigned_to_id = topic.assignment&.assigned_to_id + assigned_to_type = topic.assignment&.assigned_to_type if info[:user]&.id == assigned_to_id && assigned_to_type == "User" TopicTrackingState.publish_assigned_private_message(topic, assigned_to_id)