From 49065a3084b11addb46cc91fe6fdc737884d3b87 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sun, 13 Dec 2015 23:28:33 -0500 Subject: [PATCH] don't add nil values and add an error msg --- Bast/lua/chardb.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Bast/lua/chardb.lua b/Bast/lua/chardb.lua index 253f9a21..25260142 100644 --- a/Bast/lua/chardb.lua +++ b/Bast/lua/chardb.lua @@ -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