Commit 990b76e6 authored by Patrick José Pereira's avatar Patrick José Pereira

APMSensorsComponentController: Check zero value before division

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent 23764290
......@@ -782,7 +782,7 @@ void APMSensorsComponentController::_handleMagCalProgress(mavlink_message_t& mes
}
}
if (magCalProgress.compass_id < 3) {
if (magCalProgress.compass_id < 3 && compassCalCount != 0) {
// Each compass gets a portion of the overall progress
_rgCompassCalProgress[magCalProgress.compass_id] = magCalProgress.completion_pct / compassCalCount;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment