Skip to content

Commit

Permalink
fix: check if scene component is null (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
cazala authored Feb 14, 2024
1 parent 1a8b63d commit 0204878
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ const Metrics = withSdk<WithSdkProps>(({ sdk }) => {
}, [sdk])

const handleUpdateSceneLayout = useCallback(() => {
const scene = sdk.components.Scene.get(ROOT)
setSceneLayout({ ...(scene.layout as Layout) })
const scene = sdk.components.Scene.getOrNull(ROOT)
if (scene) {
setSceneLayout({ ...(scene.layout as Layout) })
}
}, [sdk, setSceneLayout])

useEffect(() => {
Expand Down

0 comments on commit 0204878

Please sign in to comment.