mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 05:07:10 -05:00
fix assertion failure when recovering notetype
Notes need to have their notetype ID updated to reflect the newly created notetype. https://forums.ankiweb.net/t/anki-crashes-on-sync-study-export/1978
This commit is contained in:
parent
8363719994
commit
06a69c25e6
1 changed files with 3 additions and 0 deletions
|
|
@ -267,6 +267,9 @@ impl Collection {
|
||||||
out.field_count_mismatch += 1;
|
out.field_count_mismatch += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// note type ID may have changed if we created a recovery notetype
|
||||||
|
note.ntid = nt.id;
|
||||||
|
|
||||||
// write note, updating tags and generating missing cards
|
// write note, updating tags and generating missing cards
|
||||||
let ctx = genctx.get_or_insert_with(|| CardGenContext::new(&nt, usn));
|
let ctx = genctx.get_or_insert_with(|| CardGenContext::new(&nt, usn));
|
||||||
self.update_note_inner_generating_cards(&ctx, &mut note, false, norm)?;
|
self.update_note_inner_generating_cards(&ctx, &mut note, false, norm)?;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue