Check for object type before calling method, prevent fatal error in failing test.