summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdimension/prtree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libdimension/prtree.c b/libdimension/prtree.c
index a40100c..a4f8b96 100644
--- a/libdimension/prtree.c
+++ b/libdimension/prtree.c
@@ -418,6 +418,12 @@ dmnsn_pseudo_prtree_leaves(const dmnsn_pseudo_prtree *pseudo)
{
dmnsn_list *leaves = dmnsn_new_list(sizeof(dmnsn_prtree *));
dmnsn_pseudo_prtree_leaves_recursive(pseudo, leaves);
+
+ if (dmnsn_list_size(leaves) == 0) {
+ dmnsn_prtree *prnode = dmnsn_new_prtree_node(&pseudo->leaf);
+ dmnsn_list_push(leaves, &prnode);
+ }
+
return leaves;
}