Skip to content

fix: (RenderTexture): Add optional chaining to prevent TypeError #2465

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gaievskyi
Copy link

Why

RenderTexture.js:39 Uncaught TypeError: Cannot read properties of undefined (reading 'parent')
at RenderTexture.useCallback[uvCompute] [as compute] (RenderTexture.js:39:29)
at handleRaycast (events-dc44c1b8.esm.js:541:62)
at Array.flatMap ()
at intersect (events-dc44c1b8.esm.js:553:6)
at HTMLDivElement.handleEvent (events-dc44c1b8.esm.js:788:20)

What

Add optional chaining to prevent runtime Uncaught TypeError when obtaining the parent. If parent is undefined, we fall into the next line with truthy check and early return instead of runtime error.

if (!parent) return false

Copy link

vercel bot commented Jun 13, 2025

@gaievskyi is attempting to deploy a commit to the Poimandres Team on Vercel.

A member of the Team first needs to authorize it.

@gaievskyi gaievskyi changed the title Add optional chaining to prevent TypeError fix: (RenderTexture): Add optional chaining to prevent TypeError Jun 13, 2025
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