Skip to content

A platform for community discussion. Free, open, simple.

REFACTOR: Shorten up category param check

Blake Ericksonccc1e85bf429
diff --git a/lib/topic_creator.rb b/lib/topic_creator.rb
index db325d3a80f..396dabb4f3c 100644
--- a/lib/topic_creator.rb
+++ b/lib/topic_creator.rb
@@ -121,7 +121,7 @@ class TopicCreator
category = find_category
@guardian.ensure_can_create!(Topic, category) unless (@opts[:skip_validations] || @opts[:archetype] == Archetype.private_message)
- raise Discourse::NotFound if @opts[:category] && !@opts[:category].blank? && category.nil?
+ raise Discourse::NotFound if @opts[:category].present? && category.nil?
topic_params[:category_id] = category.id if category.present?