From 101402bb952a092814144fb22710cada8858becc 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 ++- app/views/conferences/show.html.haml | 2 +- 3 files changed, 5 insertions(+), 3 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 diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index d43c99cf..ea99b419 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -29,7 +29,7 @@ - if @conference.registration_open? = render 'registration', conference: @conference, registration_period: @conference.registration_period, - tickets: @tickets, conference_id: @conference_id.short_title + tickets: @tickets, conference_id: @conference.short_title - if @conference.splashpage.include_tickets && @conference.tickets.any? = render 'tickets', conference: @conference, tickets: @tickets