From 909620db186d2c0624203830815447d64729240b Mon Sep 17 00:00:00 2001 From: jbrw Date: Fri, 1 Sep 2023 12:43:25 -0400 Subject: [PATCH] FIX: Allow pending posts to have empty titles (#23366) It's possible for a pending post to have a nil title. The PendingPostSerializer should not throw an error when this is encountered. --- app/serializers/pending_post_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/pending_post_serializer.rb b/app/serializers/pending_post_serializer.rb index 9c0c7ce3bb7..f3163ba0a6d 100644 --- a/app/serializers/pending_post_serializer.rb +++ b/app/serializers/pending_post_serializer.rb @@ -22,6 +22,6 @@ class PendingPostSerializer < ApplicationSerializer end def title - payload["title"] || topic.title + payload["title"] || topic&.title end end