From 79108daeb0d828ca8a61b673e03ba0886f92039f Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Sat, 23 May 2015 18:15:29 +0100 Subject: [PATCH] Bugfix. We might not have a @poll for this district and election. #19 --- app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.rb b/app.rb index 6a9da15..d840cdc 100644 --- a/app.rb +++ b/app.rb @@ -261,7 +261,7 @@ get '/bodies/:body/elections/:date/:districts_name/:district' do if @total_seats == 1 @share_denominator = @total_votes - elsif @poll.valid_ballot_papers + elsif @poll && @poll.valid_ballot_papers @share_denominator = @poll.valid_ballot_papers else @share_denominator = @total_votes / @total_seats