mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: In case that category is nil it should not throw an error
This commit is contained in:
@@ -645,7 +645,7 @@ SQL
|
|||||||
|
|
||||||
Category.where(id: new_category.id).update_all("topic_count = topic_count + 1")
|
Category.where(id: new_category.id).update_all("topic_count = topic_count + 1")
|
||||||
CategoryFeaturedTopic.feature_topics_for(old_category) unless @import_mode
|
CategoryFeaturedTopic.feature_topics_for(old_category) unless @import_mode
|
||||||
CategoryFeaturedTopic.feature_topics_for(new_category) unless @import_mode || old_category.id == new_category.id
|
CategoryFeaturedTopic.feature_topics_for(new_category) unless @import_mode || old_category.try(:id) == new_category.id
|
||||||
end
|
end
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|||||||
Reference in New Issue
Block a user