aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2021-02-28 17:10:40 +0000
committersfan5 <sfan5@live.de>2021-04-05 16:01:03 +0200
commitcd840b7c9d1f228bab94c5f58b5df235d6c0a180 (patch)
tree4d8e7319ffe23f9f7eedfedeebe3dbd30dfd7caf /builtin/mainmenu
parent07903949ec329c4856e15a020bb3c48f851405d8 (diff)
downloadminetest-cd840b7c9d1f228bab94c5f58b5df235d6c0a180.tar.gz
minetest-cd840b7c9d1f228bab94c5f58b5df235d6c0a180.tar.bz2
minetest-cd840b7c9d1f228bab94c5f58b5df235d6c0a180.zip
pkgmgr: Fix crash when .conf release field is invalid
Fixes #10942
Diffstat (limited to 'builtin/mainmenu')
-rw-r--r--builtin/mainmenu/pkgmgr.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/mainmenu/pkgmgr.lua b/builtin/mainmenu/pkgmgr.lua
index 19127d8d3..4aa05d838 100644
--- a/builtin/mainmenu/pkgmgr.lua
+++ b/builtin/mainmenu/pkgmgr.lua
@@ -90,7 +90,7 @@ local function load_texture_packs(txtpath, retval)
retval[#retval + 1] = {
name = item,
author = conf:get("author"),
- release = tonumber(conf:get("release") or "0"),
+ release = tonumber(conf:get("release")) or 0,
list_name = name,
type = "txp",
path = path,
@@ -135,7 +135,7 @@ function get_mods(path,retval,modpack)
-- Read from config
toadd.name = name
toadd.author = mod_conf.author
- toadd.release = tonumber(mod_conf.release or "0")
+ toadd.release = tonumber(mod_conf.release) or 0
toadd.path = prefix
toadd.type = "mod"