Browse Source

love.graphics.isSupported now errors if an invalid string is given (see issue #690)

Alex Szpakowski 12 years ago
parent
commit
72068ba519
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 2 - 4
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: