We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5769113 commit ecdd587Copy full SHA for ecdd587
x-pack/platform/plugins/shared/stack_alerts/public/rule_types/geo_containment/rule_form/rule_form.tsx
@@ -17,10 +17,11 @@ export const RuleForm: React.FunctionComponent<
17
RuleTypeParamsExpressionProps<GeoContainmentAlertParams>
18
> = (props) => {
19
function getValidationError(key: string) {
20
- // @ts-expect-error upgrade typescript v5.1.6
21
- return props.errors[key]?.length > 0 && key in props.ruleParams
22
- ? (props.errors[key] as string[])[0]
23
- : null;
+ const error = props.errors[key];
+ if (Array.isArray(error) && error.length > 0 && key in props.ruleParams) {
+ return typeof error[0] === 'string' ? error[0] : null;
+ }
24
+ return null;
25
}
26
27
return (
0 commit comments