Fix string index out of bounds in TokenSwitchFieldHandlerbuild.gradlegetToken