(panel_recursive_cd_to_parent): fix potential null pointer dereference.