diff --git a/src/main/java/org/sonarlint/intellij/finding/LiveFinding.java b/src/main/java/org/sonarlint/intellij/finding/LiveFinding.java index ca74e9f4e..a18cac363 100644 --- a/src/main/java/org/sonarlint/intellij/finding/LiveFinding.java +++ b/src/main/java/org/sonarlint/intellij/finding/LiveFinding.java @@ -95,9 +95,15 @@ protected LiveFinding(Module module, RaisedFindingDto finding, VirtualFile virtu this.severity = null; this.cleanCodeAttribute = CleanCodeAttribute.fromDto(finding.getSeverityMode().getRight().getCleanCodeAttribute()); this.impacts = finding.getSeverityMode().getRight().getImpacts(); - var highestQualityImpact = Collections.max(impacts, Comparator.comparing(ImpactDto::getImpactSeverity)); - this.highestQuality = SoftwareQuality.fromDto(highestQualityImpact.getSoftwareQuality()); - this.highestImpact = ImpactSeverity.fromDto(highestQualityImpact.getImpactSeverity()); + // Is empty for Security Hotspots + if (!impacts.isEmpty()) { + var highestQualityImpact = Collections.max(impacts, Comparator.comparing(ImpactDto::getImpactSeverity)); + this.highestQuality = SoftwareQuality.fromDto(highestQualityImpact.getSoftwareQuality()); + this.highestImpact = ImpactSeverity.fromDto(highestQualityImpact.getImpactSeverity()); + } else { + this.highestQuality = null; + this.highestImpact = null; + } } }