waterWang opened a new pull request, #21716:
URL: https://github.com/apache/echarts/pull/21716

   ## Fix: skip invalid markLine items that were normalized to undefined
   
   ### Issue
   Fixes #21683
   
   ### Problem
   When a markLine data entry is an empty object `{}`:
   ```js
   markLine: {
       data: [
           { yAxis: 1 },
           {},          // <-- empty entry
           { yAxis: 3 }
       ]
   }
   ```
   
   `markLineTransform` normalizes the empty object to `[undefined, undefined, 
{...}]`.
   The subsequent `markLineFilter` call then crashes on `item[0].coord` because 
`item[0]` is `undefined`,
   causing **no markLines to be rendered at all** — not even the valid ones.
   
   ### Root Cause
   In `markLineTransform`, the `else` branch (invalid data) sets `itemArray = 
[]`, but the function continues to construct `normalizedItem` from 
`itemArray[0]`, `itemArray[1]`, `itemArray[2]` — all of which are `undefined`. 
The filter then crashes on the undefined values.
   
   ### Fix
   Added a guard in `markLineFilter` to return `false` (skip) when `item[0]` or 
`item[1]` is undefined, which is the expected behavior: invalid entries should 
be silently skipped and valid entries should still render.
   
   ### Verification
   - Valid markLines continue to render when no empty entries exist
   - An empty `{}` entry is silently skipped without error
   - Other valid markLines in the same data array still render normally
   


-- 
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