FIX: Ensure move_to_inbox does not raise error when unassigned (#190)

This commit is contained in:
David Taylor 2021-08-27 15:22:24 +01:00 committed by GitHub
parent 9d7d39705e
commit 978f3d74a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -518,8 +518,8 @@ after_initialize do
on(:move_to_inbox) do |info|
topic = info[:topic]
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)