airqo-platform / airqo-platform/AirQo-api
Add guard against division by zero in checkUnassignedDevices function
未关闭
- 主要语言
- JavaScript
- 星标
- 26
- 派生
- 24
- 平均合并
- 5 小时 36 分钟
- 30 天内合并 PR
- 81
描述
In `src/device-registry/bin/jobs/check-unassigned-devices-job.js`, the calculation of `percentage` could result in a division by zero error when `totalCount` is zero. A guard should be added to handle this case.
PR: https://github.com/airqo-platform/AirQo-api/pull/3740
Comment: https://github.com/airqo-platform/AirQo-api/pull/3740#discussion_r1813344806
Requested by @Baalmart.
贡献指南
评估
这个 Issue 还没有评估数据。