diff --git a/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js b/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js index d487d98fbfa9a..26b4a32c7c600 100644 --- a/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js +++ b/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js @@ -29,7 +29,7 @@ function useSlotRegistry() { const { [ name ]: slot, ...nextSlots } = prevSlots; // Make sure we're not unregistering a slot registered by another element // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412 - if ( slot.ref === ref ) { + if ( slot?.ref === ref ) { return nextSlots; } return prevSlots;