From 8a77ea1007acfbeb40f9c01b5ee7b39c698ffa8a Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 16 Sep 2017 20:01:48 -0300 Subject: [PATCH] Improve the error message when a type other than a table is given as the 3rd arg to newCanvas. --HG-- branch : minor --- src/modules/graphics/wrap_Graphics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/graphics/wrap_Graphics.cpp b/src/modules/graphics/wrap_Graphics.cpp index c5af63025..8da39ea79 100644 --- a/src/modules/graphics/wrap_Graphics.cpp +++ b/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);