Update checkDescriptor method.

Check if descriptor is an object first.