]> projects.mako.cc - selectricity-live/blobdiff - app/models/quick_vote.rb
Fix crasher when nil is passed to ident_to_quickvote
[selectricity-live] / 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?