handle nil product descriptions

This commit is contained in:
Andy Brett
2021-01-13 20:57:27 -08:00
parent 67e5825739
commit bbd7fd0350
2 changed files with 7 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ class Api::ProductSerializer < ActiveModel::Serializer
# return a sanitized html description
def description_html
sanitizer.sanitize_content(object.description).html_safe
sanitizer.sanitize_content(object.description)&.html_safe
end
def properties_with_values