From cc6efb095b49f4d106d2b3496c680775964df879 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 2 Dec 2020 10:16:56 -0300 Subject: [PATCH] no fallar si no hay cuerpo en la vista previa --- app/models/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 3a1dcd12..0a7b9596 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -113,7 +113,7 @@ class Post < OpenStruct # Notificar a les usuaries que están viendo una previsualización # XXX: Asume que estamos usando Bootstrap :B - html.at_css('body').first_element_child.before("
#{I18n.t('posts.preview.message')}
") + html.at_css('body')&.first_element_child&.before("
#{I18n.t('posts.preview.message')}
") # Cacofonía html.to_html.html_safe