I think a simple `if group_parent == new_section_ref" should take care of either one being `None`.  No need to compare id.