diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index ca4aff00..c9230e5f 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -4935,6 +4935,10 @@ void lovrPassTorus(Pass* pass, float* transform, uint32_t segmentsT, uint32_t se .index.count = indexCount }); + if (!vertices) { + return; + } + // T and P stand for toroidal and poloidal, or theta and phi float dt = (2.f * (float) M_PI) / segmentsT; float dp = (2.f * (float) M_PI) / segmentsP;