Filter out Type parameter

Hello

Please, could somebody help?

I have created this script to look for doors with a Type Description, if it finds it then it filters it out so that I can order those marks by a value and the others by another, I’m getting a dereferencing non-pointer, I have attached the script.
Thank you

auto renumber category elements non Curtain Wall Door.dyn (15.6 KB)