Skip to content

Commit

Permalink
#384 make replacement of auth user sign in sql more robust to missing…
Browse files Browse the repository at this point in the history
… values, e.g. in unit tests ;-)
  • Loading branch information
KlausRicharz committed Jul 19, 2024
1 parent 7191a5b commit 83d8554
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/tb/reporting/service/ReportingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public ReportResult execute(Long reportDefinitionId, Map<String, Object> paramet
}

String sql = reportDefinition.get().getSql();
sql = sql.replace("###-AUTH-USER-SIGN-###", authorizedUser.getSign()); // ensure the sign is filled in as requested
if(sql != null && authorizedUser != null && authorizedUser.getSign() != null) {
sql = sql.replace("###-AUTH-USER-SIGN-###", authorizedUser.getSign()); // ensure the sign is filled in as requested
}
final var rowset = new NamedParameterJdbcTemplate(dataSource).queryForRowSet(sql, parameters);
var result = new ReportResult();

Expand Down

0 comments on commit 83d8554

Please sign in to comment.