Skip to content

Commit

Permalink
AccumulatedShadows NPE protection (#1701)
Browse files Browse the repository at this point in the history
* AccumulatedShadows NPE protection

* Update AccumulativeShadows.tsx

* Update AccumulativeShadows.tsx

* Update AccumulativeShadows.tsx

* Update AccumulativeShadows.tsx

---------

Co-authored-by: greg perry <[email protected]>
  • Loading branch information
supertick and greg perry authored Dec 18, 2023
1 parent 30108d2 commit 8da6b24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/AccumulativeShadows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ export const RandomizedLight: ForwardRefComponent<
React.useImperativeHandle(forwardRef, () => api, [api])
React.useLayoutEffect(() => {
const group = gLights.current
if (parent) parent.lights.set(group.uuid, api)
return () => void parent.lights.delete(group.uuid)
if (parent) parent.lights?.set(group.uuid, api)
return () => void parent?.lights?.delete(group.uuid)
}, [parent, api])

return (
Expand Down

1 comment on commit 8da6b24

@vercel
Copy link

@vercel vercel bot commented on 8da6b24 Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.