From 2f24e3f5e26737c682079d0f56c5ab58b81e6bf8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 11 Mar 2020 15:18:28 +1000 Subject: [PATCH] don't error when an add-on passes None to CardStats https://anki.tenderapp.com/discussions/beta-testing/1842-syncing-message --- pylib/anki/stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pylib/anki/stats.py b/pylib/anki/stats.py index cbbf4f20d..c8ffa2c0b 100644 --- a/pylib/anki/stats.py +++ b/pylib/anki/stats.py @@ -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 = ""