BZ1048950 - Invalid enumeration not detected
(cherry picked from commit cbfcaef05e711e83b987a934beb2413e6b3d764f)