Missing CID value

The decoded token I’m receiving does not contain a cid value, this is causing to fail as it is expecting to receive the cid as a string and it’s being nil.
The cid validation is expecting to match a string but as the token does not contain the cid it is trying to match a string with nil, which of course is failing.
Why is the cid expected and needed to be validated?
How can I solve this issue?