Change method to raise an exception if the expected variant is not found

* For some reason this returns nil when no variant is found, yet later on in the
  code it makes assumptions about the value being a real variant. While this
  does not solve the problem it should raise an exception closer to the point
  where the invalid state is introduced into the program so it can finally be
  fixed.