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
  cd840b7c9d
stable-5.2-namespace
mckaygerhard 2023-09-17 15:25:47 -04:00
parent 2af5896ed1
commit 9d09cf17d2
1 changed files with 2 additions and 2 deletions

View File

@ -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,