Skip to content

Add missing guard for worker instance in playground compilation - #212

Open
prjanitor wants to merge 1 commit into
jmjuanes:mainfrom
prjanitor:prjanitor/a1ad7db8a346cad8f664409fc0e05157417305ba
Open

Add missing guard for worker instance in playground compilation#212
prjanitor wants to merge 1 commit into
jmjuanes:mainfrom
prjanitor:prjanitor/a1ad7db8a346cad8f664409fc0e05157417305ba

Conversation

@prjanitor

Copy link
Copy Markdown

In playground/App.jsx, the compile function was being called with worker.current without verifying if it had been initialized yet. Since worker is a useRef that gets populated via useEffect, there's a window where it is undefined. This change adds a guard to prevent calling compile when the worker is not ready.


This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

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.

1 participant