Skip to content

Commit

Permalink
Components: SlotFill: Guard property access to possibly-undefined slot (
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored Mar 27, 2020
1 parent eb2138c commit 4e17ff0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4e17ff0

Please sign in to comment.