If statements in plugins throw an error?

Does the code use FindFirstChild? FindFirstChild returns nil instead of throwing an error if the child instance you’re trying to find doesn’t exist.

if workspace:FindFirstChild("whatever") then
    -- ...
end
-- or:
local whatever = workspace:FindFirstChild("whatever")
if whatever then
    -- ...
end
1 Like