FIX: Ensure archive_message does not raise error when unassigned

This commit is contained in:
Andrei Prigorshnev 2021-08-27 16:57:53 +02:00
parent 978f3d74a1
commit f14653857f
No known key found for this signature in database
GPG Key ID: 185E0A5F45783902
1 changed files with 2 additions and 2 deletions

View File

@ -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)