diff --git a/decidim-core/app/helpers/decidim/icon_helper.rb b/decidim-core/app/helpers/decidim/icon_helper.rb index a2a7653bbecd8..ce2602bae2200 100644 --- a/decidim-core/app/helpers/decidim/icon_helper.rb +++ b/decidim-core/app/helpers/decidim/icon_helper.rb @@ -24,7 +24,7 @@ def component_icon(component, options = {}) # # Returns an HTML tag with the icon. def manifest_icon(manifest, options = {}) - if manifest.icon + if manifest.respond_to?(:icon) && manifest.icon.present? external_icon manifest.icon, options else icon "question-mark", options @@ -42,9 +42,9 @@ def manifest_icon(manifest, options = {}) def resource_icon(resource, options = {}) if resource.class.name == "Decidim::Comments::Comment" icon "comment-square", options - elsif resource.respond_to?(:component) + elsif resource.respond_to?(:component) && resource.component.present? component_icon(resource.component, options) - elsif resource.respond_to?(:manifest) + elsif resource.respond_to?(:manifest) && resource.manifest.present? manifest_icon(resource.manifest, options) elsif resource.is_a?(Decidim::User) icon "person", options