Skip to content

fix(core): Don’t error if turn.order.next returns undefined#614

Merged
nicolodavis merged 3 commits into
boardgameio:masterfrom
delucis:delucis/fix/turn-order-next
Apr 11, 2020
Merged

fix(core): Don’t error if turn.order.next returns undefined#614
nicolodavis merged 3 commits into
boardgameio:masterfrom
delucis:delucis/fix/turn-order-next

Conversation

@delucis
Copy link
Copy Markdown
Member

@delucis delucis commented Apr 11, 2020

Fixes a bug raised by @flamecoals in #605 where an error is logged if turn.order.next returns undefined, which is permitted as a way of ending the phase.

I’ve also amended the turn order interface to indicate that next can return undefined.

nicolodavis
nicolodavis previously approved these changes Apr 11, 2020
@nicolodavis
Copy link
Copy Markdown
Member

Perhaps we should change the interface (in the future) to return a constant END_PHASE to make it more obvious.

@nicolodavis nicolodavis merged commit f34f46b into boardgameio:master Apr 11, 2020
@delucis delucis deleted the delucis/fix/turn-order-next branch April 11, 2020 11:12
@jasonharrison
Copy link
Copy Markdown
Contributor

I ran into this on v0.39.6 (where the changelog https://github.com/nicolodavis/boardgame.io/blob/master/docs/documentation/CHANGELOG.md says this was fixed)

It looks like @delucis 's commit was reverted in eb1e060#diff-ffe51a82f97e27f74a79b6b8382009e3L292

Was this accidental?

@nicolodavis
Copy link
Copy Markdown
Member

Ah, that looks like a bad merge.

@nicolodavis
Copy link
Copy Markdown
Member

Fixed and released in 0.39.7.

nicolodavis added a commit that referenced this pull request Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants