Ignore invalid I/O notetypes when deciding whether to add

https://forums.ankiweb.net/t/can-t-add-new-cards/37155
This commit is contained in:
Damien Elmes 2023-11-15 13:32:02 +10:00
parent 07909a54e2
commit 469052700f

View File

@ -46,7 +46,9 @@ impl Collection {
pub(crate) fn get_first_io_notetype(&mut self) -> Result<Option<Arc<Notetype>>> { pub(crate) fn get_first_io_notetype(&mut self) -> Result<Option<Arc<Notetype>>> {
for nt in self.get_all_notetypes()? { for nt in self.get_all_notetypes()? {
if nt.config.original_stock_kind() == OriginalStockKind::ImageOcclusion { 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));
}
} }
} }