Browse Source

Improve the error message when a type other than a table is given as the 3rd arg to newCanvas.

--HG--
branch : minor
Alex Szpakowski 8 years ago
parent
commit
8a77ea1007
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/modules/graphics/wrap_Graphics.cpp

+ 2 - 0
src/modules/graphics/wrap_Graphics.cpp

@@ -1144,6 +1144,8 @@ int w_newCanvas(lua_State *L)
 
 	if (!lua_isnoneornil(L, startidx))
 	{
+		luaL_checktype(L, startidx, LUA_TTABLE);
+
 		settings.pixeldensity = (float) luax_numberflag(L, startidx, "pixeldensity", settings.pixeldensity);
 		settings.msaa = luax_intflag(L, startidx, "msaa", settings.msaa);