Skip to content

Commit 02536b1

Browse files
authored
Merge pull request #1909 from afumagalli98/fix-newavgpercentage
Fixed newAvgPercentage
2 parents 04b0b2b + fe3bdad commit 02536b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api-service/service/technologies_api.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ func (as *APIService) ListManagedTechnologies(sortBy string, sortDesc bool, loca
4848
totCompliance += lc.Compliance
4949
}
5050

51-
newAvgPercentage := totCompliance / float64(len(licCompliances))
51+
if len(licCompliances) > 0 {
52+
newAvgPercentage := totCompliance / float64(len(licCompliances))
5253

53-
oracleStatus.NewAvgPercentage = newAvgPercentage
54+
oracleStatus.NewAvgPercentage = newAvgPercentage
55+
}
5456

5557
statuses = append(statuses, *oracleStatus)
5658

0 commit comments

Comments
 (0)