Handle the case when parentNode is null.