From 1bf146179d3192670a9e9f076568570a84b07671 Mon Sep 17 00:00:00 2001 From: Ella Date: Thu, 14 Nov 2024 15:39:31 +0100 Subject: [PATCH] Guard for undefined --- .../edit-site/src/components/global-styles-sidebar/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-site/src/components/global-styles-sidebar/index.js b/packages/edit-site/src/components/global-styles-sidebar/index.js index 423f54f233929..d46346b50dae3 100644 --- a/packages/edit-site/src/components/global-styles-sidebar/index.js +++ b/packages/edit-site/src/components/global-styles-sidebar/index.js @@ -133,7 +133,7 @@ export default function GlobalStylesSidebar() { const previousActiveAreaRef = useRef( null ); useEffect( () => { - if ( path.startsWith( '/wp_global_styles' ) && canvas === 'edit' ) { + if ( path?.startsWith( '/wp_global_styles' ) && canvas === 'edit' ) { previousActiveAreaRef.current = getActiveComplementaryArea( 'core' ); enableComplementaryArea( 'core', 'edit-site/global-styles' );