From e7bfbe85528a0db0324d3b877870d35d9a21f155 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 30 Dec 2014 01:42:36 +0530 Subject: [PATCH] FIX: deleted topics were failing user posts archive download --- app/jobs/regular/export_csv_file.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/jobs/regular/export_csv_file.rb b/app/jobs/regular/export_csv_file.rb index 0382089cdf9..c0b86a7f92b 100644 --- a/app/jobs/regular/export_csv_file.rb +++ b/app/jobs/regular/export_csv_file.rb @@ -132,6 +132,10 @@ module Jobs user_archive_array = [] topic_data = user_archive.topic user_archive = user_archive.as_json + if topic_data.nil? + # deleted topic + topic_data = Topic.with_deleted.find_by(id: user_archive['topic_id']) + end category = topic_data.category sub_category = "-" if category