Skip to content

Commit

Permalink
better client message and assertion, phetsims/density-buoyancy-common…
Browse files Browse the repository at this point in the history
…#386

Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed Sep 6, 2024
1 parent 0364817 commit b3926da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions js/nodes/IndexedNodeIO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const IndexedNodeIO = new IOType( 'IndexedNodeIO', {
// away another IndexedNode state set. See https://github.com/phetsims/ph-scale/issues/227
const children = nodeParent.children;
const currentIndex = nodeParent.indexOfChild( node );
assert && assert( stateObject.index < children.length, 'index goes beyond number of children' );
children[ currentIndex ] = children[ stateObject.index ];
children[ stateObject.index ] = node;
nodeParent.setChildren( children );
Expand Down

0 comments on commit b3926da

Please sign in to comment.