Skip to content

Commit

Permalink
Update ReportStreamSenderHelper.java
Browse files Browse the repository at this point in the history
Update getReportId to handle empty string cases
  • Loading branch information
luis-pabon-tf committed Jul 16, 2024
1 parent 4209515 commit 1056675
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ protected Optional<String> getReportId(String rsResponseBody) {
try {
Map<String, Object> rsResponse =
formatter.convertJsonToObject(rsResponseBody, new TypeReference<>() {});
return Optional.ofNullable(rsResponse.get("reportId").toString());
String reportId = rsResponse.get("reportId").toString();
if (!reportId.isEmpty()) {
return Optional.of(reportId);
}
} catch (FormatterProcessingException | NullPointerException e) {
logger.logError("Unable to get the reportId", e);
}
Expand Down

0 comments on commit 1056675

Please sign in to comment.