mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
Throw error if invalid canvas type was supplied in l.g.newCanvas()
This commit is contained in:
@@ -400,7 +400,8 @@ int w_newCanvas(lua_State *L)
|
|||||||
const char *str = luaL_optstring(L, 3, "normal");
|
const char *str = luaL_optstring(L, 3, "normal");
|
||||||
|
|
||||||
Canvas::TextureType texture_type;
|
Canvas::TextureType texture_type;
|
||||||
Canvas::getConstant(str, texture_type);
|
if (!Canvas::getConstant(str, texture_type))
|
||||||
|
return luaL_error(L, "Invalid canvas type: %s", str);
|
||||||
|
|
||||||
Canvas *canvas = NULL;
|
Canvas *canvas = NULL;
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user