[Positioner] AccessPoint: avoid division by zero
This commit is contained in:
parent
b8722b6a6c
commit
d3733c2083
|
@ -71,6 +71,9 @@ received_calibration_from_ap(const AccessPoint &trx) const
|
|||
expected_packets += (*cr)->get_nb_packets() ;
|
||||
}
|
||||
|
||||
if (expected_packets == 0)
|
||||
return 0 ;
|
||||
|
||||
// Compute the score (percent):
|
||||
float score = received_packets * 100.0 / expected_packets ;
|
||||
return score ;
|
||||
|
|
Loading…
Reference in New Issue