Skip to content

Commit c2ea6a3

Browse files
authored
Fix: Add NULL check to CheckCollisionLines (#5802)
1 parent ccc0d74 commit c2ea6a3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/rshapes.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,8 +2387,11 @@ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2,
23872387

23882388
if ((0.0f <= t) && (t <= 1.0f) && (0.0f <= u) && (u <= 1.0f))
23892389
{
2390-
collisionPoint->x = startPos1.x + t*rx;
2391-
collisionPoint->y = startPos1.y + t*ry;
2390+
if (collisionPoint)
2391+
{
2392+
collisionPoint->x = startPos1.x + t*rx;
2393+
collisionPoint->y = startPos1.y + t*ry;
2394+
}
23922395

23932396
collision = true;
23942397
}

0 commit comments

Comments
 (0)