From a9f3e4dca7c3ba8a92e8705351cd3def419cbc89 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 6 Sep 2009 17:31:47 +0900 Subject: [PATCH] don't throw a traceback with an invalid fid --- anki/deck.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/anki/deck.py b/anki/deck.py index 011dc8ba5..1de98cf63 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -1864,7 +1864,12 @@ where id = :id""", pending) token = token[3:] type = SEARCH_TYPE elif token.startswith("fid:") and len(token) > 4: - token = token[4:] + dec = token[4:] + try: + int(dec) + token = token[4:] + except: + token = "0" type = SEARCH_FID else: type = SEARCH_PHRASE