From 469052700f0dec988e90076fe06dec5a7f5d057f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 15 Nov 2023 13:32:02 +1000 Subject: [PATCH] Ignore invalid I/O notetypes when deciding whether to add https://forums.ankiweb.net/t/can-t-add-new-cards/37155 --- rslib/src/image_occlusion/notetype.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rslib/src/image_occlusion/notetype.rs b/rslib/src/image_occlusion/notetype.rs index 488a29cfd..5537c90fa 100644 --- a/rslib/src/image_occlusion/notetype.rs +++ b/rslib/src/image_occlusion/notetype.rs @@ -46,7 +46,9 @@ impl Collection { pub(crate) fn get_first_io_notetype(&mut self) -> Result>> { for nt in self.get_all_notetypes()? { if nt.config.original_stock_kind() == OriginalStockKind::ImageOcclusion { - return Some(io_notetype_if_valid(nt)).transpose(); + if let Ok(nt) = io_notetype_if_valid(nt) { + return Ok(Some(nt)); + } } }