Let us handle cases where parent is null. Sanity check for child

This fixes bug 3700.