Fix crash when drawing zero lines;

This commit is contained in:
bjorn 2021-02-19 08:38:45 -07:00
parent 7ef215c312
commit 0365f51f9d
1 changed files with 1 additions and 0 deletions

View File

@ -921,6 +921,7 @@ static int l_lovrGraphicsPoints(lua_State* L) {
static int l_lovrGraphicsLine(lua_State* L) {
float* vertices;
uint32_t count = luax_getvertexcount(L, 1);
lovrAssert(count >= 2, "Need at least 2 points to draw a line");
lovrGraphicsLine(count, &vertices);
luax_readvertices(L, 1, vertices, count);
return 0;