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 and jorgefilipecosta committed Mar 27, 2020
1 parent d15e01c commit d023c3e
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 d023c3e

Please sign in to comment.