Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(canvas): fix potential NPE in canvas pattern dirty callback handler#1032

Merged
plainheart merged 1 commit into
masterfrom
fix-canvas-layer-painter
Sep 23, 2023
Merged

fix(canvas): fix potential NPE in canvas pattern dirty callback handler#1032
plainheart merged 1 commit into
masterfrom
fix-canvas-layer-painter

Conversation

@plainheart
Copy link
Copy Markdown
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