Avoid crashing when calling 'classForObject()' with a nil object