BasePart:CanCollideWith crashes when called with invalid arguments

Issue:
Calling BasePart:CanCollideWith with invalid arguments causes the Roblox instance to crash (Whether in Roblox Studio, Roblox Client or in a Roblox server.)

Expected Behavior:
This shouldn’t crash the instance and instead error saying the provided argument must be a part.

Reproduction:

local Pa:Part = Instance.new'Part'
Pa.Parent = workspace
Pa:CanCollideWith(game)

Run this in Roblox Studio or in a Roblox developer console in a live/test game.

Attached Picture:
Crash

3 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

1 Like

Fixed. You now get a friendly message in the output:

local part = Instance.new("Part")
part.Parent = workspace
part:CanCollideWith(game)

> CanCollideWith expects a BasePart argument.
6 Likes

This topic was automatically closed after 7 days. New replies are no longer allowed.