From 9d09cf17d212e6d1f6fcd084b071359389e29ea3 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 17 Sep 2023 15:25:47 -0400 Subject: [PATCH] pkgmgr: Fix crash when .conf release field is invalid * Fixes Issue when trying to access online content https://github.com/minetest/minetest/issues/10942 * backported https://github.com/minetest/minetest/commit/cd840b7c9d1f228bab94c5f58b5df235d6c0a180 --- builtin/mainmenu/pkgmgr.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/mainmenu/pkgmgr.lua b/builtin/mainmenu/pkgmgr.lua index 5b8807310..7a1f2a5aa 100644 --- a/builtin/mainmenu/pkgmgr.lua +++ b/builtin/mainmenu/pkgmgr.lua @@ -107,7 +107,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" @@ -155,7 +155,7 @@ function pkgmgr.get_texture_packs() 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,