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

FIX: Resetting bump date shouldn't fail when first post is hidden
diff --git a/app/models/topic.rb b/app/models/topic.rb
index d9ad81b..0afa508 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

GitHub
sha: 126be6c4

2 Likes