From d3a4a74f5b0a7fe8463dc0400e2c534d0bf4eb8e Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Thu, 2 Jan 2025 12:13:19 +0530 Subject: [PATCH] Adding null check for payload --- .../src/apps/dashboard/components/shared/customDiffEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/customDiffEditor.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/customDiffEditor.js index 8d405033e5..dc5e61ca4c 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/customDiffEditor.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/customDiffEditor.js @@ -256,7 +256,7 @@ const transform = { }) } finalData = finalData.split("\n").sort().join("\n"); - const isPayloadEmpty = Object.keys(payLoad).length === 0 + const isPayloadEmpty = payLoad === null || Object.keys(payLoad).length === 0 const isMultiformData = data?.json?.requestHeaders?.['content-type']?.includes('multipart/form-data') return (localFirstLine + "\n" + finalData + (finalData.trim().length === 0 || isPayloadEmpty ? "\n" : "\n\n") + (!isPayloadEmpty ? (isMultiformData ? payLoad : this.formatJson(payLoad)) : '')) }