fixed crash in cpv tree when sub_code is null