Does the officer have to be wearing a hat at the time of a traffic stop?

If he/she is required to have the hat, does not having the hat (and being shown on the officer's video) void the ticket?