From 81a4598c87a961a864ea206ea7e6ab2c4137e7af Mon Sep 17 00:00:00 2001 From: rahul Date: Mon, 11 Sep 2017 23:01:28 +0530 Subject: [PATCH] Fix error while generating pdf when venue is nil Error in generating pdf for ticket when venue is not set is fixed.Showing venue in pdf only if venue exist. Closes https://github.com/opensuse/osem/issues/1683 --- app/pdfs/ticket_pdf.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/pdfs/ticket_pdf.rb b/app/pdfs/ticket_pdf.rb index ecb4cd2c..48f26fe3 100644 --- a/app/pdfs/ticket_pdf.rb +++ b/app/pdfs/ticket_pdf.rb @@ -51,7 +51,9 @@ class TicketPdf < Prawn::Document move_down 70 draw_text @conference.title.to_s, at: [@mid_horizontal + 30, cursor - 30], size: 12 draw_text @conference.organization.name.to_s, at: [@mid_horizontal + 30, cursor - 50], size: 12 - draw_text @conference.venue.name.to_s, at: [@mid_horizontal + 30, cursor - 70] + if @conference.venue + draw_text @conference.venue.name.to_s, at: [@mid_horizontal + 30, cursor - 70] + end move_up 130 move_down @mid_vertical end