Skip to content

fix: Add null check for utils.getMorePropsForChart#706

Open
mm0 wants to merge 2 commits intoreact-financial:mainfrom
mm0:patch-1
Open

fix: Add null check for utils.getMorePropsForChart#706
mm0 wants to merge 2 commits intoreact-financial:mainfrom
mm0:patch-1

Conversation

@mm0
Copy link

@mm0 mm0 commented Mar 9, 2024

When using the FibonacciRetracements component, I get an exception:

utils.ts:77 Uncaught TypeError: Cannot read properties of undefined (reading 'find')
    at getMorePropsForChart (utils.ts:77:1)
    at DrawingObjectSelector.tsx:39:1
    at index.ts:150:1
    at Array.forEach (<anonymous>)
    at mapObject (index.ts:148:1)
    at DrawingObjectSelector.getInteraction (DrawingObjectSelector.tsx:32:1)
    at DrawingObjectSelector.handleClick [as onMouseDown] (DrawingObjectSelector.tsx:67:1)
    at GenericComponent.evaluateType (GenericComponent.tsx:160:1)
    at GenericComponent.listener (GenericComponent.tsx:118:1)
    at ChartCanvas.tsx:911:1

In other places in the source code, I see that there is usually an explicit check for the chartConfig property. I have copied that here in utils.tsx

Checklist

@mm0 mm0 marked this pull request as ready for review March 9, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant