WaitForChild timeout handled improperly

After WaitForChild times out, then after the expected child is added, an attempt to call a nil value error is thrown.

parent = Instance.new("BoolValue")
child = Instance.new("BoolValue")
child.Name = "Value"

parent:WaitForChild("Value", 0.1)
child.Parent = parent
--> attempt to call a nil value

After multiple timeouts, cannot resume non-suspended coroutine errors are thrown.

parent = Instance.new("BoolValue")
child = Instance.new("BoolValue")
child.Name = "Value"

for i = 1, 10 do
	parent:WaitForChild("Value", 0.1)
end
child.Parent = parent
--> attempt to call a nil value
--> cannot resume non-suspended coroutine (x9)
4 Likes

Thank you for reporting this issue along with a repro. We think we have found the issue, and a fix is in development.

2 Likes

We have enabled the fix for this today, please give it another try and let us know if it is still acting up for your use case.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.