From 6a20d127725d6493998b55bb6473ec7b35a34713 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 27 Feb 2015 13:22:52 +1100 Subject: [PATCH] don't fail serializing if title is missing --- app/serializers/post_revision_serializer.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/serializers/post_revision_serializer.rb b/app/serializers/post_revision_serializer.rb index 0565a1a0032..1f8c07adf58 100644 --- a/app/serializers/post_revision_serializer.rb +++ b/app/serializers/post_revision_serializer.rb @@ -112,8 +112,10 @@ class PostRevisionSerializer < ApplicationSerializer end def title_changes - prev = "
#{CGI::escapeHTML(previous["title"])}
" - cur = "
#{CGI::escapeHTML(current["title"])}
" + + prev = "
#{previous["title"] && CGI::escapeHTML(previous["title"])}
" + cur = "
#{current["title"] && CGI::escapeHTML(current["title"])}
" + return if prev == cur diff = DiscourseDiff.new(prev, cur)