diff --git a/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx b/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx index f9aef2fb67..02bd3716f9 100644 --- a/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx +++ b/frontend/src/AppBuilder/CodeEditor/PreviewBox.jsx @@ -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;