mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Handle deeply nested decks
This commit is contained in:
parent
c4d71eae2f
commit
f017525ea8
1 changed files with 4 additions and 1 deletions
|
@ -32,7 +32,10 @@ fn add_child_nodes(
|
|||
) {
|
||||
while let Some((id, name)) = names.peek() {
|
||||
let split_name: Vec<_> = name.split("::").collect();
|
||||
match split_name.len() as u32 {
|
||||
// protobuf refuses to decode messages with 100+ levels of nesting, and
|
||||
// broken collections with such nesting have been found in the wild
|
||||
let capped_len = split_name.len().min(99) as u32;
|
||||
match capped_len {
|
||||
l if l <= parent.level => {
|
||||
// next item is at a higher level
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue