FIX: do not attempt to unassign the deleted topic

This commit is contained in:
Arpit Jalan 2018-04-03 13:44:02 +05:30
parent e7d38c905b
commit 390a08a196
1 changed files with 2 additions and 0 deletions

View File

@ -167,6 +167,8 @@ SQL
@topic.save! @topic.save!
post = @topic.posts.where(post_number: 1).first post = @topic.posts.where(post_number: 1).first
return unless post.present?
post.publish_change_to_clients!(:revised, reload_topic: true) post.publish_change_to_clients!(:revised, reload_topic: true)
assigned_user = User.find_by(id: assigned_to_id) assigned_user = User.find_by(id: assigned_to_id)