Skip to content

Commit c86ab3f

Browse files
committed
fix: do not include root in children
1 parent b222614 commit c86ab3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mega/filesystem.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def build(cls, nodes: Sequence[Node]) -> Self:
115115

116116
for node in nodes:
117117
nodes_map[node.id] = node
118-
children.setdefault(node.parent_id, []).append(node.id)
118+
if node.parent_id:
119+
children.setdefault(node.parent_id, []).append(node.id)
119120
match node.type:
120121
case NodeType.FILE:
121122
file_count += 1

0 commit comments

Comments
 (0)