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

Only replace original render callback if not set #272

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

menno-ll
Copy link
Member

Issue link

https://app.asana.com/0/1206316631984075/1207645749086440/f

Description

parse_blocks can crash beacuse of an infinite loop.
Somehow for the image block the constructor can be called twice, resulting in the original render callback beeing the same as the render callback.
Because they became the same, the following call to fallback to the original render callback if no custom callback is available, will then cause an infinite loop (because render callback is calling the same render callback,etc).

This solution aims to solve this by only allowing the original render callback to be set once.
It's the original, so that should always be allright.

How Has This Been Tested?

In a project, by running parse_blocks with an image block in the content present.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@menno-ll menno-ll added the bug label Jun 24, 2024
@menno-ll menno-ll merged commit 39d600e into master Jun 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants