@@ -173,14 +173,16 @@ private Document generateReport(final Connection connection,
173
173
for (AwardCategory category : AwardDeterminationOrder .get (connection , challengeDescription )) {
174
174
switch (category ) {
175
175
case PerformanceScoreCategory awardCategory -> {
176
- final Element performance = createPerformanceBlock (document , connection , challengeDescription , tournament ,
177
- groupName , category );
178
- if (!first ) {
179
- report .appendChild (FOPUtils .createHorizontalLineBlock (document , SEPARATOR_THICKNESS ));
180
- } else {
181
- first = false ;
176
+ final @ Nullable Element performance = createPerformanceBlock (document , connection , challengeDescription ,
177
+ tournament , groupName , category );
178
+ if (null != performance ) {
179
+ if (!first ) {
180
+ report .appendChild (FOPUtils .createHorizontalLineBlock (document , SEPARATOR_THICKNESS ));
181
+ } else {
182
+ first = false ;
183
+ }
184
+ report .appendChild (performance );
182
185
}
183
- report .appendChild (performance );
184
186
}
185
187
case NonNumericCategory awardCategory -> {
186
188
if (!CategoriesIgnored .isNonNumericCategoryIgnored (connection , tournament .getLevel (), awardCategory )) {
@@ -280,12 +282,12 @@ private Element createChampionsBlock(final Document document) {
280
282
return section ;
281
283
}
282
284
283
- private Element createPerformanceBlock (final Document document ,
284
- final Connection connection ,
285
- final ChallengeDescription description ,
286
- final Tournament tournament ,
287
- final String groupName ,
288
- final AwardCategory awardCategory )
285
+ private @ Nullable Element createPerformanceBlock (final Document document ,
286
+ final Connection connection ,
287
+ final ChallengeDescription description ,
288
+ final Tournament tournament ,
289
+ final String groupName ,
290
+ final AwardCategory awardCategory )
289
291
throws SQLException {
290
292
final Map <Integer , TournamentTeam > tournamentTeams = Queries .getTournamentTeams (connection ,
291
293
tournament .getTournamentID ());
@@ -326,6 +328,10 @@ private Element createPerformanceBlock(final Document document,
326
328
groupName ));
327
329
}
328
330
331
+ if (scores .isEmpty ()) {
332
+ return null ;
333
+ }
334
+
329
335
for (final Top10 .ScoreEntry entry : scores ) {
330
336
if (entry .getRank () > NUM_PERFORMANCE_FINALISTS ) {
331
337
break ;
0 commit comments