Fix: use HasField

This commit is contained in:
Luc Mcgrady 2025-10-30 18:11:41 +00:00
parent fc8a2f9739
commit 112f951a13
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C

View file

@ -690,10 +690,10 @@ def play_audio():
card = aqt.mw.col.get_card(CardId(req.cid))
# TODO: Pass tags with next_card_data rather than rendering the card here.
tags = card.answer_av_tags() if req.answer_side else card.question_av_tags()
if req.index is None:
play_tags(tags)
else:
if req.HasField("index"):
play_tags([tags[req.index]])
else:
play_tags(tags)
post_handler_list = [