Fix Shader:getBufferFormat crashing instead of erroring when the buffer name doesn't exist in the shader.

This commit is contained in:
Sasha Szpakowski
2024-11-24 13:30:07 -04:00
parent f8b1942ce4
commit 2904ba7739
+1 -1
View File
@@ -519,7 +519,7 @@ int w_Shader_getBufferFormat(lua_State *L)
Shader *shader = luax_checkshader(L, 1);
const char *name = luaL_checkstring(L, 2);
const std::vector<Buffer::DataDeclaration> *format = shader->getBufferFormat(name);
if (name != nullptr)
if (format != nullptr)
{
lua_createtable(L, (int)format->size(), 0);