From cc65196b0a5a92b2bdd58af3cde8ed91568665c4 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 2 Aug 2021 16:27:48 +1000 Subject: [PATCH] revert to defaults when schema 11 deck config can not be read Allows decks with missing/null values like ivlFct to be opened. https://forums.ankiweb.net/t/i-cant-access-ankiweb/11814 --- rslib/src/deckconfig/schema11.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rslib/src/deckconfig/schema11.rs b/rslib/src/deckconfig/schema11.rs index 33802828f..4b451cbca 100644 --- a/rslib/src/deckconfig/schema11.rs +++ b/rslib/src/deckconfig/schema11.rs @@ -29,8 +29,11 @@ pub struct DeckConfSchema11 { timer: u8, #[serde(default)] replayq: bool, + #[serde(deserialize_with = "default_on_invalid")] pub(crate) new: NewConfSchema11, + #[serde(deserialize_with = "default_on_invalid")] pub(crate) rev: RevConfSchema11, + #[serde(deserialize_with = "default_on_invalid")] pub(crate) lapse: LapseConfSchema11, #[serde(rename = "dyn", default, deserialize_with = "default_on_invalid")] dynamic: bool,