`.getEnumConstants()` returns `null` if the type is not an enum. This error message should only be generated for enums.