### Elasticsearch Version

8.11.0

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

MacOS

### Problem Description

When sending a ESQL query with the `enrich` command that involves a policy that does not existing a `NullPointerException` is thrown and shown as error messages to the user:

Query:
```
row a  = 1| enrich missing-policy
```

Returns:
```
null_pointer_exception - Cannot invoke "org.elasticsearch.xpack.core.enrich.EnrichPolicy.getMatchField()" because "policy" is null
```

### Steps to Reproduce

See above.

### Logs (if relevant)

_No response_
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java
? new UnresolvedAttribute(
                    plan.policyName().source(),
                    policyName,
                    null,
                    unresolvedPolicyError(policyName, context.enrichResolution())
                )
                : plan.policyName();
            var matchField = plan.matchField() == null || plan.matchField() instanceof EmptyAttribute
                ? new UnresolvedAttribute(plan.source(), policy.getMatchField())
                : plan.matchField();
            List<NamedExpression> enrichFields = policy == null || idx == null
                ? (plan.enrichFields() == null ? List.of() : plan.enrichFields())
                : calculateEnrichFields(
                    plan.source(),
                    policyName,
                    mappingAsAttributes(plan.source(), idx.get().mapping()),
                    plan.enrichFields(),
                    policy
                );
            return new Enrich(plan.source(), plan.child(), policyNameExp, matchField, policyRes, enrichFields);
        }
        private String unresolvedPolicyError(String policyName, EnrichResolution enrichResolution) {
            List<String> potentialMatches = StringUtils.findSimilar(policyName, enrichResolution.existingPolicies());
            String msg = "unresolved enrich policy [" + policyName + "]";
            if (CollectionUtils.isEmpty(potentialMatches) == false) {
                msg += ", did you mean "
                    + (potentialMatches.size() == 1 ? "[" + potentialMatches.get(0) + "]" : "any of " + potentialMatches)
                    + "?";
            }
            return msg;