From: John Dong Date: Thu, 16 Aug 2007 17:09:31 +0000 (-0400) Subject: Fix crasher when nil is passed to ident_to_quickvote X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/e682e1ecce33417f8410e71bd58d385c47e37c5b Fix crasher when nil is passed to ident_to_quickvote --- diff --git a/app/models/quick_vote.rb b/app/models/quick_vote.rb index c427b98..ce4a4fb 100644 --- a/app/models/quick_vote.rb +++ b/app/models/quick_vote.rb @@ -75,6 +75,7 @@ class QuickVote < Election ### Convert a shortname or id into a QuickVote def self.ident_to_quickvote(ident) + return nil unless ident if ident.match(/^\d+$/) quickvote = QuickVote.find(ident) else