Skip to content

Commit

Permalink
don't add nil values and add an error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
endavis committed Dec 14, 2015
1 parent 4096605 commit 49065a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Bast/lua/chardb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ function Statdb:addtostat(stat, add)
if tonumber(add) == 0 then
return true
end
if add == nil then
ColourNote("red", "", "Trying to add a nil value to " .. tostring(stat) .. ", please report this to Bast")
ColourNote("red", "", "please type 'whois' to reset current stats")
return false
end
if self:open('addtostat') then
local tstat = nil
for a in self.db:nrows('SELECT * FROM stats WHERE milestone = "current"') do
Expand Down

0 comments on commit 49065a3

Please sign in to comment.