Skip to content

Commit

Permalink
Version 1.4.1
Browse files Browse the repository at this point in the history
 * Fix NPE on startup.
  • Loading branch information
totemo committed Jan 24, 2023
1 parent f81cc1e commit dcb5241
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>nu.nerd</groupId>
<artifactId>DragonFight</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>

<description>Custom dragon fight.</description>
<url>https://github.com/NerdNu/${project.name}</url>
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/nu/nerd/df/FightState.java
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,15 @@ protected void animateNextStage() {
return;
}

// I have observed that sometimes the config has stage-number: 0 and
// new-stage-number: 1, and there are no crystals. In that case, getting
// the next crystal to remove by _crystals.iterator() fails and there
// is an exception. Avoid that.
// TODO: work out why we get into this inconsistent state and fix it.
if (_crystals.isEmpty()) {
return;
}

// From here forward, getNewStageNumber() is between 1 and 10.
// Remove a random crystal. Random order due to hashing UUID.
EnderCrystal replacedCrystal = _crystals.iterator().next();
Expand Down

0 comments on commit dcb5241

Please sign in to comment.