From e3b5c4d01980ba509c39a4d5ba8a47e891f85263 Mon Sep 17 00:00:00 2001 From: Katrin Bratland <115959+katpet@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:58:43 -0800 Subject: [PATCH] Update StatsbookExporter.java Fix a bug in penalty box stats export where a BoxTrip may have invalid data, so can't assume there's a start fielding. --- .../scoreboard/utils/StatsbookExporter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/carolinarollergirls/scoreboard/utils/StatsbookExporter.java b/src/com/carolinarollergirls/scoreboard/utils/StatsbookExporter.java index f3d40061..f5606492 100644 --- a/src/com/carolinarollergirls/scoreboard/utils/StatsbookExporter.java +++ b/src/com/carolinarollergirls/scoreboard/utils/StatsbookExporter.java @@ -358,10 +358,10 @@ private void fillBox(Sheet box, List sortedBoxtrips, Team t) { } List 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);