From 72068ba5192da0d04f38dfa8490597bd398cad6a Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 17 Aug 2013 00:12:46 -0300 Subject: [PATCH] love.graphics.isSupported now errors if an invalid string is given (see issue #690) --- src/modules/graphics/opengl/wrap_Graphics.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index f261092e9..22fcd9fd2 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -1051,10 +1051,8 @@ int w_isSupported(lua_State *L) { const char *str = luaL_checkstring(L, i); if (!Graphics::getConstant(str, support)) - { - supported = false; - break; - } + return luaL_error(L, "Invalid graphics feature: %s", str); + switch (support) { case Graphics::SUPPORT_CANVAS: