mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 13:37:28 +00:00
fix: handle null check in PreviewCodeBlock (#15597)
Some checks are pending
CI / build (push) Waiting to run
CI / lint-for-plugins (push) Blocked by required conditions
CI / lint-for-frontend (push) Blocked by required conditions
CI / lint-for-server (push) Blocked by required conditions
CI / unit-test (push) Blocked by required conditions
CI / e2e-test (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / lint-for-plugins (push) Blocked by required conditions
CI / lint-for-frontend (push) Blocked by required conditions
CI / lint-for-server (push) Blocked by required conditions
CI / unit-test (push) Blocked by required conditions
CI / e2e-test (push) Blocked by required conditions
This commit is contained in:
parent
7a8041274b
commit
35f2c474fd
1 changed files with 2 additions and 2 deletions
|
|
@ -134,7 +134,7 @@ export const PreviewBox = ({
|
|||
const globalServerConstantsRegex = /\{\{.*globals\.server.*\}\}/;
|
||||
|
||||
const getPreviewContent = (content, type) => {
|
||||
if (content === undefined || content === null) return currentValue;
|
||||
if (content === undefined) return currentValue;
|
||||
try {
|
||||
switch (type) {
|
||||
case 'Object':
|
||||
|
|
@ -741,7 +741,7 @@ const PreviewCodeBlock = ({ code, isExpectValue = false, isLargeDataset }) => {
|
|||
|
||||
const typeOfValue = typeof prettyPrintedJson;
|
||||
|
||||
if (typeOfValue === 'object' || typeOfValue === 'array') {
|
||||
if (prettyPrintedJson !== null && (typeOfValue === 'object' || typeOfValue === 'array')) {
|
||||
showJSONTree = true;
|
||||
} else {
|
||||
prettyPrintedJson = preview;
|
||||
|
|
|
|||
Loading…
Reference in a new issue