Check that petnames index exists

main
Bob Mottram 2025-08-25 19:17:01 +01:00
parent aece53b151
commit 04841ab471
1 changed files with 30 additions and 27 deletions

View File

@ -973,10 +973,13 @@ def _add_mention(base_dir: str, word_str: str, http_prefix: str,
return True return True
# try replacing petnames with mentions # try replacing petnames with mentions
follow_ctr = 0 follow_ctr = 0
if petnames:
for follow in following: for follow in following:
if '@' not in follow: if '@' not in follow:
follow_ctr += 1 follow_ctr += 1
continue continue
pet = None
if len(petnames) > follow_ctr:
pet = remove_eol(petnames[follow_ctr]) pet = remove_eol(petnames[follow_ctr])
if pet: if pet:
if possible_nickname != pet: if possible_nickname != pet: