diff --git a/pylib/anki/rsbackend.py b/pylib/anki/rsbackend.py index 8d39ff70c..33e9290c3 100644 --- a/pylib/anki/rsbackend.py +++ b/pylib/anki/rsbackend.py @@ -485,7 +485,11 @@ class RustBackend: ).search_notes.note_ids def get_card(self, cid: int) -> Optional[pb.Card]: - return self._run_command(pb.BackendInput(get_card=cid)).get_card.card + output = self._run_command(pb.BackendInput(get_card=cid)).get_card + if output.HasField("card"): + return output.card + else: + return None def update_card(self, card: BackendCard) -> None: self._run_command(pb.BackendInput(update_card=card))