mirror of
https://git.sr.ht/~rjarry/aerc
synced 2026-09-28 12:01:57 +02:00
pruneEmptyContainers recurses into a container's children (case 3) but never re-checks the container afterwards. If the container is a placeholder (threadable == nil) and the recursion clears all its children, it becomes an empty node that remains in the root set. gatherSubjects then crashes accessing c.child.threadable. Fix by checking after the recursive call: if the container now has no threadable and no children, remove it from the parent's list using the same pattern as case 1. Fixes: https://todo.sr.ht/~rjarry/aerc/353 Changelog-fixed: Crash when threading maildir messages with references that create empty dummy containers in the root set. Reported-by: Robert Vojta <rovojta@gmail.com> Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>