If object has a humanoid then

Hello Roblox,

So i want to make a code that checks if something has a humanoid. Thats my code:

for _, object in ipairs(workspace:GetDescendants()) do
	if object:IsA("ProximityPrompt") then
		if object.Parent.Humanoid then
			print("working")
		end
	end
end

But the error is that i have a door with proximityprompt and because that I cant use that code.
Please help me

~Maini

Replace object.Parent.Humanoid for object.Parent:FindFirstChild("Humanoid"). Find first child will return the child if it can find it, or return nil if it cannot find it. - Meaning there won’t be an error if it cannot find a Humanoid