Skip to content

Commit f2ab09e

Browse files
authored
CLDR-17560 skip invalid report ids (#3773)
1 parent c1dc8c7 commit f2ab09e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/cldr-apps/src/main/java/org/unicode/cldr/web/ReportsDB.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,16 @@ public ReportStatus getReportStatus(Integer user, CLDRLocale locale) {
9191
locale.getBaseName());
9292
ResultSet rs = ps.executeQuery(); ) {
9393
while (rs.next()) {
94-
final String report = rs.getString("report");
94+
final String reportStr = rs.getString("report");
95+
ReportId report = null;
96+
try {
97+
report = ReportId.valueOf(reportStr);
98+
} catch (IllegalArgumentException iae) {
99+
continue; // skip illegal enum values. may be a 'retired' enum
100+
}
95101
final Boolean completed = rs.getBoolean("completed");
96102
final Boolean acceptable = rs.getBoolean("acceptable");
97-
status.mark(ReportId.valueOf(report), completed, acceptable);
103+
status.mark(report, completed, acceptable);
98104
}
99105
} catch (SQLException e) {
100106
SurveyLog.logException(e, "fetching reportStatus for " + user + ":" + locale);

0 commit comments

Comments
 (0)