From 2e2649b4ae7983bcbd7a673d681f61cecb06cb4f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:05:48 +0000 Subject: [PATCH] fix: handle null in CSV preview (#26154) (cherry picked from commit e93b0e8948a4c5489f7a599f12a368ebac6d5461) Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com> --- frappe/public/js/frappe/views/reports/report_utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/public/js/frappe/views/reports/report_utils.js b/frappe/public/js/frappe/views/reports/report_utils.js index 3caf2314640..7d1378924a7 100644 --- a/frappe/public/js/frappe/views/reports/report_utils.js +++ b/frappe/public/js/frappe/views/reports/report_utils.js @@ -289,6 +289,10 @@ frappe.report_utils = { .map((row) => { return row .map((col) => { + if (col === null) { + return ""; + } + if (typeof col == "string" && col.includes('"')) { col = col.replace(/"/g, '""'); }