From 6eb55fe509ec7fa120ab80eea471a2d7c2e2efe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Ba=C3=B1ados=20Schwerter?= Date: Tue, 8 Oct 2024 20:09:29 +0000 Subject: [PATCH] Hotfix for issue #1198 --- src/CreeDictionary/API/search/presentation.py | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/CreeDictionary/API/search/presentation.py b/src/CreeDictionary/API/search/presentation.py index 252e32786..14d0d8071 100644 --- a/src/CreeDictionary/API/search/presentation.py +++ b/src/CreeDictionary/API/search/presentation.py @@ -506,16 +506,20 @@ def get_lexical_info( entries.append(entry) url = "search?q=" + preverb_text _type = "Preverb" - id: Optional[int] = entries[0]["id"] - result = _LexicalEntry( - entry=cast(Any, entries), - text=preverb_text, - url=url, - id=id, - type=_type, - original_tag=tag, - ) - lexical_info.append(result) + try: + id: Optional[int] = entries[0]["id"] + result = _LexicalEntry( + entry=cast(Any, entries), + text=preverb_text, + url=url, + id=id, + type=_type, + original_tag=tag, + ) + lexical_info.append(result) + except IndexError: + # Pretend we didn't find it. + preverb_result1 = Wordform(text=preverb_text, is_lemma=True) else: # Can't find a match for the preverb in the database. # This happens when searching against the test database for