Skip to content

Commit

Permalink
🐛 Referenced operation can be without validation
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Jan 26, 2021
1 parent ad51514 commit 4ae7fb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x-pack/plugins/lens/public/indexpattern_datasource/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function isColumnInvalid(
const operationDefinition = column.operationType && operationDefinitionMap[column.operationType];
// check also references for errors
const referencesHaveErrors =
true &&
'references' in column &&
Boolean(getReferencesErrors(layer, column, indexPattern).filter(Boolean).length);

Expand All @@ -72,7 +73,7 @@ function getReferencesErrors(
return column.references?.map((referenceId: string) => {
const referencedOperation = layer.columns[referenceId]?.operationType;
const referencedDefinition = operationDefinitionMap[referencedOperation];
return referencedDefinition.getErrorMessage?.(layer, referenceId, indexPattern);
return referencedDefinition?.getErrorMessage?.(layer, referenceId, indexPattern);
});
}

Expand Down

0 comments on commit 4ae7fb4

Please sign in to comment.