From ada178d62c7b5d96000b81173cdebe4d7b65da48 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Tue, 26 Dec 2017 13:57:32 +0530 Subject: [PATCH] Added check for image_tag occurences. Checking for presence of a image before using image_tag Fixes #1909 --- app/views/admin/sponsors/index.html.haml | 3 ++- app/views/conferences/_modal_description.haml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/admin/sponsors/index.html.haml b/app/views/admin/sponsors/index.html.haml index 1c8f1077..d2fc512c 100644 --- a/app/views/admin/sponsors/index.html.haml +++ b/app/views/admin/sponsors/index.html.haml @@ -19,7 +19,8 @@ - @conference.sponsors.each do |sponsor| %tr %td - = image_tag(sponsor.picture.thumb.url, width: '20%') + - if sponsor.picture? + = image_tag(sponsor.picture.thumb.url, width: '20%') %td = sponsor.name %td diff --git a/app/views/conferences/_modal_description.haml b/app/views/conferences/_modal_description.haml index eb6f2b69..7fe4173b 100644 --- a/app/views/conferences/_modal_description.haml +++ b/app/views/conferences/_modal_description.haml @@ -15,7 +15,8 @@ - if object.is_a? Sponsor - img_classes << ['img-sponsor', "img-sponsor-#{object.sponsorship_level.position}"] - = image_tag get_logo(object), class: img_classes + - if object.picture? + = image_tag get_logo(object), class: img_classes %p.description = object.description .modal-footer