Skip to content

Commit

Permalink
Only access ObservableArray member if it exists, see #43
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 11, 2019
1 parent 01c8ae8 commit 4c4bcd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/game/model/FractionChallenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ define( require => {
this.selectedGroupProperty.value = this.previouslySelectedGroupProperty.value;
}
else {
const firstGroup = this.shapeGroups.get( 0 ) || this.numberGroups.get( 0 );
const firstGroup = this.shapeGroups.length > 0 ? this.shapeGroups.get( 0 ) :
this.numberGroups.length > 0 ? this.numberGroups.get( 0 ) :
null;

// If there is no previously-selected group, we'll just select the first one.
// See https://github.com/phetsims/fractions-common/issues/43#issuecomment-454149966
Expand Down

0 comments on commit 4c4bcd0

Please sign in to comment.