Skip to content

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

FIX: Resetting bump date shouldn't fail when first post is hidden

Gerhard Schlager126be6c4784c
diff --git a/app/models/topic.rb b/app/models/topic.rb
index d9ad81b9e58..0afa508bf9d 100644
--- a/app/models/topic.rb
+++ b/app/models/topic.rb
@@ -1357,7 +1357,7 @@ class Topic < ActiveRecord::Base
user_deleted: false,
hidden: false,
post_type: Post.types[:regular]
- ).last
+ ).last || first_post
update!(bumped_at: post.created_at)
end