You can check if your image contains an xmp profile with the following code:
The number behind the error message is a line number.
if (image.GetProfile("xmp") == null) // do something