summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/api.lua b/api.lua
index 17d9e09..2fe2e22 100644
--- a/api.lua
+++ b/api.lua
@@ -51,12 +51,14 @@ local function convert_data()
local ret = {}
local count = 0
- for modname, items in pairs(data[from]) do
- for itemname, value in pairs(items) do
- itemname = modname .. ":" .. itemname
- local key = minetest.registered_aliases[itemname] or itemname
- ret[key] = value
- count = count + value
+ if data[from] then
+ for modname, items in pairs(data[from]) do
+ for itemname, value in pairs(items) do
+ itemname = modname .. ":" .. itemname
+ local key = minetest.registered_aliases[itemname] or itemname
+ ret[key] = value
+ count = count + value
+ end
end
end