Skip to content

Commit

Permalink
Update StatsbookExporter.java
Browse files Browse the repository at this point in the history
Fix a bug in penalty box stats export where a BoxTrip may have invalid data, so can't assume there's a start fielding.
  • Loading branch information
katpet committed Nov 7, 2023
1 parent 7c751bc commit e3b5c4d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ private void fillBox(Sheet box, List<BoxTrip> sortedBoxtrips, Team t) {
}
List<Period> periods = new ArrayList<>(game.getAll(Game.PERIOD));
int period = bt.getPeriodNumber();
if(!(period == 1 || period == 2))
if(!(period == 1 || period == 2) || bt.getStartFielding() == null)
continue;
String skaterNumber = "";
String role = bt.get(BoxTrip.START_FIELDING).getCurrentRole().toString().substring(0, 1);
String role = bt.getStartFielding().getCurrentRole().toString().substring(0, 1);
int startJamNumber = bt.get(BoxTrip.START_JAM_NUMBER);
int endJamNumber = bt.get(BoxTrip.END_JAM_NUMBER);
long duration = bt.get(BoxTrip.DURATION);
Expand Down

0 comments on commit e3b5c4d

Please sign in to comment.