bad argument #1 to 'pairs' (table expected, got nil) - HELP PLEASE!!

ERROR ON CONSOLE:



[ERROR] addons/elitef4menu ru/lua/autorun/client/elite_food.lua:27: bad argument #1 to 'pairs' (table expected, got nil)
  1. pairs - [C]:-1
   2. unknown - addons/elitef4menu ru/lua/autorun/client/elite_food.lua:27


CODE:


FoodItems = {}
function DarkRP.createFood(name, mdl, energy, price)
    local foodItem = istable(mdl) and mdl or {model = mdl, energy = energy, price = price}
    foodItem.name = name

    if DarkRP.DARKRP_LOADING and DarkRP.disabledDefaults["food"][name] then return end

    for k,v in pairs(validFood) do
        local isFunction = isfunction(v)

        if (isFunction and not v(foodItem[k])) or (not isFunction and foodItem[v] == nil) then
            ErrorNoHalt("Corrupt food \"" .. (name or "") .. "\": element " .. (isFunction and k or v) .. " is corrupt.
")
        end
    end

    table.insert(FoodItems, foodItem)
end
AddF

the variable validFood is nil, don’t know how clearer that error can be