Skip to content

Commit

Permalink
Ensure that openref is defined before accessing to .current (#62508)
Browse files Browse the repository at this point in the history
* Ensure that openref is defined before accessing to .current

* add comment

Co-authored-by: gigitux <gigitux@git.wordpress.org>
Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>
Co-authored-by: vcanales <vcanales@git.wordpress.org>
  • Loading branch information
4 people authored and ellatrix committed Jun 18, 2024
1 parent 4d5ae89 commit 426938a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export function useInBetweenInserter() {
}

function onMouseMove( event ) {
if ( openRef.current ) {
// openRef is the reference to the insertion point between blocks.
// If the reference is not set or the insertion point is already open, return.
if ( openRef === undefined || openRef.current ) {
return;
}

Expand Down

0 comments on commit 426938a

Please sign in to comment.