Skip to content

fix(marker): skip invalid markLine data items instead of crashing the…#21696

Open
aloktomarr wants to merge 1 commit into
apache:masterfrom
aloktomarr:fix/markLine-empty-data-21683
Open

fix(marker): skip invalid markLine data items instead of crashing the…#21696
aloktomarr wants to merge 1 commit into
apache:masterfrom
aloktomarr:fix/markLine-empty-data-21683

Conversation

@aloktomarr

@aloktomarr aloktomarr commented Jul 17, 2026

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Prevents a single empty/invalid markLine.data entry (e.g. {}) from throwing and wiping out all markLines in the series.

Fixed issues

Details

Before: What was the problem?

An empty object {} in markLine.data is normalized to [undefined, undefined, {...}]. markLineFilter then read item[0].coord/item[1].coord on the undefined endpoints, throwing TypeError: Cannot read properties of undefined (reading 'coord'). This aborted rendering of every markLine in the series, so no markLine was drawn at all.

After: How does it behave after the fixing?

markLineFilter now treats an item with a missing endpoint as invalid and filters it out. The empty entry is skipped and the remaining valid markLines render normally. A regression unit test was added (test/ut/spec/component/marker/MarkLine.test.ts) that asserts setOption does not throw and the valid markLines are still rendered.

Document Info

  • This PR doesn't relate to document changes

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

  • This PR depends on ZRender changes.

Merging options

  • Please squash the commits into a single one when merging.

@echarts-bot

echarts-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] No markLine drawn if one of the markLines is empty

1 participant