github-advanced-security[bot] commented on code in PR #16226: URL: https://github.com/apache/druid/pull/16226#discussion_r1548916228
########## indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java: ########## @@ -1683,21 +1684,29 @@ final SimpleRowIngestionMeters buildSegmentsRowStats = new SimpleRowIngestionMeters(); for (String runningTaskId : runningTaskIds) { try { - final Map<String, Object> report = getTaskReport(toolbox.getOverlordClient(), runningTaskId); + final TaskReport.ReportMap report = getTaskReport(toolbox.getOverlordClient(), runningTaskId); if (report == null || report.isEmpty()) { // task does not have a running report yet continue; } - Map<String, Object> ingestionStatsAndErrors = (Map<String, Object>) report.get("ingestionStatsAndErrors"); - Map<String, Object> payload = (Map<String, Object>) ingestionStatsAndErrors.get("payload"); - Map<String, Object> rowStats = (Map<String, Object>) payload.get("rowStats"); + final Optional<IngestionStatsAndErrorsTaskReport> ingestionStatsReport + = report.findReport(IngestionStatsAndErrorsTaskReport.REPORT_KEY); + + final IngestionStatsAndErrors payload; + if (ingestionStatsReport.isPresent()) { + payload = ingestionStatsReport.get().getPayload(); + } else { + payload = null; + } + + Map<String, Object> rowStats = payload.getRowStats(); Review Comment: ## Dereferenced variable may be null Variable [payload](1) may be null at this access because of [this](2) assignment. [Show more details](https://github.com/apache/druid/security/code-scanning/7205) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org