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 1039f11 commit 1e3a7f4
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 1e3a7f4

Please sign in to comment.