Fix a nullPtrException when parent is gone, but child still exists