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(canvas): fix potential NPE in canvas pattern dirty callback handler #1032

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

plainheart
Copy link
Collaborator

As we discussed before, some extension libraries may create their own Layer for customization via Painter#insertLayer and probably won't inject the painter property into the canvas painter like echarts-gl and echarts-for-weixin [1], this results in a potential NPE in the canvas pattern dirty callback handler.

So it's better to remove the redundant __painter from Layer to reuse the existing painter property and inject painter in Painter#insertLayer when it doesn't exist.

[1] Error threw in echarts-for-weixin when loading the pattern

image

…`Painter#insertLayer` when it doesn't exist
@plainheart plainheart requested a review from pissang September 22, 2023 12:39
@plainheart plainheart merged commit 8288aa6 into master Sep 23, 2023
@plainheart plainheart deleted the fix-canvas-layer-painter branch September 23, 2023 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants