Skip to content

Commit

Permalink
fix assertion failure when recovering notetype
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dae committed Aug 8, 2020
1 parent 8363719 commit 06a69c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rslib/src/dbcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ impl Collection {
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
let ctx = genctx.get_or_insert_with(|| CardGenContext::new(&nt, usn));
self.update_note_inner_generating_cards(&ctx, &mut note, false, norm)?;
Expand Down

0 comments on commit 06a69c2

Please sign in to comment.