fix(saved query): handle null sql field (#11679)

This commit is contained in:
ʈᵃᵢ 2020-11-13 13:15:24 -10:00 committed by GitHub
parent 95246e8812
commit 218f58edb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ const SavedQueryPreviewModal: FunctionComponent<SavedQueryPreviewModalProps> = (
<QueryTitle>query name</QueryTitle>
<QueryLabel>{savedQuery.label}</QueryLabel>
<SyntaxHighlighter language="sql" style={github}>
{savedQuery.sql}
{savedQuery.sql || ''}
</SyntaxHighlighter>
</StyledModal>
</div>

View File

@ -56,6 +56,6 @@ export type SavedQueryObject = {
id: number;
label: string;
schema: string;
sql: string;
sql: string | null;
sql_tables?: { catalog?: string; schema: string; table: string }[];
};