Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tooltip): fix potential NPE when setting option with notMerge strategy #20435

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/component/tooltip/TooltipHTMLContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,15 @@

getSize() {
const el = this.el;
return [el.offsetWidth, el.offsetHeight];
return el ? [el.offsetWidth, el.offsetHeight] : [0, 0];
}

moveTo(zrX: number, zrY: number) {
const styleCoord = this._styleCoord;
makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY);

if (styleCoord[0] != null && styleCoord[1] != null) {
const style = this.el.style;
const style: any = this.el ? (this.el.style || {}) : {}

Check failure on line 472 in src/component/tooltip/TooltipHTMLContent.ts

View workflow job for this annotation

GitHub Actions / lint (18.x)

Missing semicolon
const transforms = assembleTransform(styleCoord[0], styleCoord[1]) as string[][];
each(transforms, (transform) => {
style[transform[0] as any] = transform[1];
Expand Down
Loading