]> projects.mako.cc - selectricity-live/commitdiff
Fix crasher when nil is passed to ident_to_quickvote
authorJohn Dong <jdong@mit.edu>
Thu, 16 Aug 2007 17:09:31 +0000 (13:09 -0400)
committerJohn Dong <jdong@mit.edu>
Thu, 16 Aug 2007 17:09:31 +0000 (13:09 -0400)
app/models/quick_vote.rb

index c427b981d78120d54ee429f8f2ee9280f9f310a9..ce4a4fb5d3fe1dd142e4db139262c68c5bc6a069 100644 (file)
@@ -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

Benjamin Mako Hill || Want to submit a patch?