avoid npe chance, use == with enums