trimclassname() would crash if it was given a NULL pointer. Now a NULL pointer is returned instead. Fixes #14