mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix decode_base64 returning nothing instead of nil (#13697)
This commit is contained in:
parent
9f25378ddd
commit
3f2a10bb4b
1 changed files with 4 additions and 2 deletions
|
@ -393,8 +393,10 @@ int ModApiUtil::l_decode_base64(lua_State *L)
|
||||||
const char *d = luaL_checklstring(L, 1, &size);
|
const char *d = luaL_checklstring(L, 1, &size);
|
||||||
const std::string data = std::string(d, size);
|
const std::string data = std::string(d, size);
|
||||||
|
|
||||||
if (!base64_is_valid(data))
|
if (!base64_is_valid(data)) {
|
||||||
return 0;
|
lua_pushnil(L);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
std::string out = base64_decode(data);
|
std::string out = base64_decode(data);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue