Commits

Alex Szpakowski committed d18b612

Error instead of crash when love.graphics.newGeometry fails

  • Participants
  • Parent commits a04ae2d

Comments (0)

Files changed (1)

File src/modules/graphics/opengl/wrap_Graphics.cpp

 		vertices.push_back(v);
 	}
 
-	Geometry *geom = instance->newGeometry(vertices);
+	Geometry *geom = 0;
+	try
+	{
+		geom = instance->newGeometry(vertices);
+	}
+	catch (love::Exception &e)
+	{
+		return luaL_error(L, "%s", e.what());
+	}
 
 	if (geom == 0)
 		return luaL_error(L, "Could not create geometry.");