From ced002a6adf5260b15a401de950209d6fa564ec7 Mon Sep 17 00:00:00 2001 From: Pravesh Sharma Date: Wed, 16 Jul 2025 17:49:00 +0530 Subject: [PATCH] Fixed an issue where json editor in result grid was crashing if null value is set in the json editor. #8907 --- .../static/js/components/QueryToolDataGrid/Editors.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx index b57393988..214faa704 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx @@ -416,6 +416,7 @@ export function JsonTextEditor({row, column, onRowChange, onClose}) { const [hasError, setHasError] = React.useState(false); const onChange = React.useCallback((newVal)=>{ + newVal = newVal == '' ? null : newVal; setLocalVal(newVal); }, []); const onOK = ()=>{ @@ -453,7 +454,7 @@ export function JsonTextEditor({row, column, onRowChange, onClose}) { className='Editors-jsonEditor' data-label="pg-editor" resizeKey={'json'} defaultSize={{height:'500px', width:'600px'}} onKeyDown={suppressEnterKey} > {setHasError(Boolean(errors));}