diff --git a/src/api/l_thread.c b/src/api/l_thread.c index 1c454c1c..f892dfa6 100644 --- a/src/api/l_thread.c +++ b/src/api/l_thread.c @@ -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");