mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Read safely from plotly-json properties to avoid crash on existing charts (#2193)
This commit is contained in:
parent
a38ebb764c
commit
46ef41fb0c
1 changed files with 2 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ class Chart extends React.Component {
|
|||
const jsonDescription = this.state.component.component.definition.properties.jsonDescription;
|
||||
|
||||
const plotFromJson = resolveReferences(
|
||||
this.state.component.component.definition.properties.plotFromJson.value,
|
||||
this.state.component.component.definition.properties.plotFromJson?.value,
|
||||
currentState
|
||||
);
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ class Chart extends React.Component {
|
|||
children: (
|
||||
<CodeHinter
|
||||
currentState={this.props.currentState}
|
||||
initialValue={jsonDescription.value}
|
||||
initialValue={jsonDescription?.value ?? {}}
|
||||
theme={this.props.darkMode ? 'monokai' : 'duotone-light'}
|
||||
mode="javascript"
|
||||
lineNumbers={false}
|
||||
|
|
|
|||
Loading…
Reference in a new issue