Fix crash on lovr.thread.newThread(nil)

This commit is contained in:
mcc 2020-01-11 14:56:26 -05:00
parent dc1c011380
commit 2a3b4694f5
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ static int l_lovrThreadNewThread(lua_State* L) {
Blob* blob = luax_totype(L, 1, Blob);
if (!blob) {
size_t length;
const char* str = lua_tolstring(L, 1, &length);
const char* str = luaL_checklstring(L, 1, &length);
if (memchr(str, '\n', MIN(1024, length))) {
void* data = malloc(length + 1);
lovrAssert(data, "Out of memory");