From 2904ba7739d506b86bdeeb45d179dbc945fd80a3 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sun, 24 Nov 2024 13:30:07 -0400 Subject: [PATCH] Fix Shader:getBufferFormat crashing instead of erroring when the buffer name doesn't exist in the shader. --- src/modules/graphics/wrap_Shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/graphics/wrap_Shader.cpp b/src/modules/graphics/wrap_Shader.cpp index 5902640ea..0d5b27f5f 100644 --- a/src/modules/graphics/wrap_Shader.cpp +++ b/src/modules/graphics/wrap_Shader.cpp @@ -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 *format = shader->getBufferFormat(name); - if (name != nullptr) + if (format != nullptr) { lua_createtable(L, (int)format->size(), 0);