don't error when an add-on passes None to CardStats

https://anki.tenderapp.com/discussions/beta-testing/1842-syncing-message
This commit is contained in:
Damien Elmes 2020-03-11 15:18:28 +10:00
parent fd81fca4aa
commit 2f24e3f5e2

View file

@ -25,7 +25,8 @@ PERIOD_LIFE = 2
class CardStats:
def __init__(self, col: anki.storage._Collection, card: anki.cards.Card) -> None:
self.col = col.weakref()
if col:
self.col = col.weakref()
self.card = card
self.txt = ""