bito-code-review[bot] commented on PR #42880:
URL: https://github.com/apache/superset/pull/42880#issuecomment-5220059124

   <!-- Bito Reply -->
   The flagged issue is correct. Calling `endsWith` on `numberFormat` will 
throw a TypeError if `numberFormat` is `null` or `undefined`. To resolve this, 
you should add a nullish check or optional chaining before calling `endsWith`.
   
   Here is the corrected implementation for 
`superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts`:
   
   ```typescript
     const percentFormatter = numberFormat?.endsWith('%')
       ? getNumberFormatter(numberFormat)
       : defaultPercentFormatter;
   ```
   
   There are no other comments on this pull request to address.
   
   **superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts**
   ```
   const percentFormatter = numberFormat?.endsWith('%')
       ? getNumberFormatter(numberFormat)
       : defaultPercentFormatter;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to