bail if MinimumRank is invalid

git-svn-id: file:///home/svn/framework3/trunk@7787 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2009-12-09 23:07:58 +00:00
parent 084a10ded5
commit 8d25dc00bc
1 changed files with 3 additions and 3 deletions

View File

@ -338,10 +338,10 @@ class Db
end
minrank = framework.datastore['MinimumRank'] || nil
if minrank and not RankingName.values.include?(minrank)
print_error("MinimumRank invalid, ignoring")
if not minrank or not RankingName.values.include?(minrank)
print_error("MinimumRank invalid! Possible values are (#{RankingName.sort.map{|r|r[1]}.join("|")})")
wlog("MinimumRank invalid, ignoring", 'core', LEV_0)
minrank = nil
return
else
minrank = RankingName.invert[minrank]
end