pkgmgr: Fix crash when .conf release field is invalid

Fixes #10942
This commit is contained in:
rubenwardy 2021-02-28 17:10:40 +00:00 committed by Nils Dagsson Moskopp
parent 94b8d680bd
commit f7301a2d25
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ local function load_texture_packs(txtpath, retval)
retval[#retval + 1] = { retval[#retval + 1] = {
name = item, name = item,
author = conf:get("author"), author = conf:get("author"),
release = tonumber(conf:get("release") or "0"), release = tonumber(conf:get("release")) or 0,
list_name = name, list_name = name,
type = "txp", type = "txp",
path = path, path = path,
@ -135,7 +135,7 @@ function get_mods(path,retval,modpack)
-- Read from config -- Read from config
toadd.name = name toadd.name = name
toadd.author = mod_conf.author 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.path = prefix
toadd.type = "mod" toadd.type = "mod"