You can use the static ReferenceEquals method of System.Object.
That's the technically correct solution. What you should do however, is to let your supplier of said class know that it is a buggy piece of shit and you won't work with it. It should not be your responsibility to fix other peoples bugs. It's enough work to fix one's own bugs.