if (curr === null) throw "AssertionError";  or something like that just in case child is not a descendant of parent?