REFACTOR: Shorten up category param check

REFACTOR: Shorten up category param check

Follow up to d1dbafebbc4b21c2a6714cd19c0ba05fac7717c4

diff --git a/lib/topic_creator.rb b/lib/topic_creator.rb
index db325d3..396dabb 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?

GitHub sha: ccc1e85b

1 Like