Commit 7274771
committed
Fix NaN handling in pct function in db-health-alerts
The function didn't validate that part and whole are finite numbers. If either
was NaN or Infinity, Math.round((part / whole) * 100) would return NaN.
Added Number.isFinite() checks to return 0 for invalid numbers.1 parent 7b65652 commit 7274771
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| |||
0 commit comments