Fixed an issue where json editor in result grid was crashing if null value is set in the json editor. #8907

pull/8965/head
Pravesh Sharma 2025-07-16 17:49:00 +05:30 committed by GitHub
parent 3aad58751a
commit ced002a6ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -416,6 +416,7 @@ export function JsonTextEditor({row, column, onRowChange, onClose}) {
const [hasError, setHasError] = React.useState(false); const [hasError, setHasError] = React.useState(false);
const onChange = React.useCallback((newVal)=>{ const onChange = React.useCallback((newVal)=>{
newVal = newVal == '' ? null : newVal;
setLocalVal(newVal); setLocalVal(newVal);
}, []); }, []);
const onOK = ()=>{ 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} > className='Editors-jsonEditor' data-label="pg-editor" resizeKey={'json'} defaultSize={{height:'500px', width:'600px'}} onKeyDown={suppressEnterKey} >
<JsonEditor <JsonEditor
setJsonEditorSize={setJsonEditorSize} setJsonEditorSize={setJsonEditorSize}
value={localVal} value={localVal??''}
options={{ options={{
onChange: onChange, onChange: onChange,
onValidationError: (errors)=>{setHasError(Boolean(errors));} onValidationError: (errors)=>{setHasError(Boolean(errors));}