fix: do not load databack if there isn't a list

This commit is contained in:
Kazhnuz Klappsthul 2021-12-04 14:09:51 +01:00
parent b670e456e4
commit b8ac8e7d51
1 changed files with 5 additions and 3 deletions

View File

@ -36,9 +36,11 @@ end
function DataManager:loadDatas()
self.datapacks = {}
for key, datas in pairs(index.datapacks) do
self.core.debug:debug("datamanager", "loading data for " .. key)
self.datapacks[key] = DataPack(datas[1], datas[2], datas[3], datas[4], datas[5])
if (index.datapacks ~= nil) then
for key, datas in pairs(index.datapacks) do
self.core.debug:debug("datamanager", "loading data for " .. key)
self.datapacks[key] = DataPack(datas[1], datas[2], datas[3], datas[4], datas[5])
end
end
end