Skip to content

Commit

Permalink
[Lens] Expression type on document can be null (#53883)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
Maja Grubic and elasticmachine authored Jan 5, 2020
1 parent a73ad23 commit 58da936
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/lens/public/app_plugin/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export function App({

const isSaveable =
lastKnownDoc &&
lastKnownDoc.expression &&
lastKnownDoc.expression.length > 0 &&
core.application.capabilities.visualize.save;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ExpressionRenderer } from 'src/plugins/expressions/public';

export interface ExpressionWrapperProps {
ExpressionRenderer: ExpressionRenderer;
expression: string;
expression: string | null;
context: {
timeRange?: TimeRange;
query?: Query;
Expand All @@ -29,7 +29,7 @@ export function ExpressionWrapper({
}: ExpressionWrapperProps) {
return (
<I18nProvider>
{expression === '' ? (
{expression === null || expression === '' ? (
<EuiFlexGroup direction="column" alignItems="center" justifyContent="center">
<EuiFlexItem>
<EuiIcon type="alert" color="danger" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Document {
type?: string;
visualizationType: string | null;
title: string;
expression: string;
expression: string | null;
state: {
datasourceMetaData: {
filterableIndexPatterns: Array<{ id: string; title: string }>;
Expand Down

0 comments on commit 58da936

Please sign in to comment.