org-clock-agg: fix divide by zero

This commit is contained in:
Pavel Korytov 2024-11-22 17:38:54 +03:00
parent e8642c02b0
commit 89d93bd486

View file

@ -717,9 +717,13 @@ TOTAL-TIME and PARENT-TIME are recursive parameters."
(dolist (node tree)
(let ((total (float (alist-get :total (cdr node)))))
(setf (alist-get :parent-share (cdr node))
(if (> 0 parent-time)
(/ total (float parent-time))
0)
(alist-get :total-share (cdr node))
(/ total (float total-time)))
(if (> 0 total-time)
(/ total (float total-time))
0))
(org-clock-agg--groupby-postaggregate
(alist-get :children (cdr node))
total-time