Skip to content

Commit

Permalink
never pass undefined to HTMLElement.insertBefore(), #715
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 15, 2018
1 parent 71b38c1 commit 5fb9122
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/accessibility/AccessiblePeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ define( function( require ) {
// The first child of the container parent element should be the peer dom element
// if undefined, the insertBefore method will insert the primarySiblingDOMElement as the first child
var primarySiblingDOMElement = this.primarySibling;
var firstChild = this.containerParent.children[ 0 ];
this.containerParent.insertBefore( primarySiblingDOMElement, firstChild );
var firstChild = this.containerParent.children[ 0 ] || null;
this.containerParent.insertBefore( primarySiblingDOMElement, firstChild );
}

// @private {boolean} - Whether we are currently in a "disposed" (in the pool) state, or are available to be
Expand Down Expand Up @@ -143,6 +143,9 @@ define( function( require ) {
return this.containerParent || this.primarySibling;
},

getTopLevelElements: function(){
},

/**
* Get an element on this node, looked up by the association flag passed in.
* @public (scenery-internal)
Expand Down

0 comments on commit 5fb9122

Please sign in to comment.