mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 10:32:21 +02:00
[fix] hostnames plugin: AttributeError: 'NoneType' object has no attribute 'netloc'
Closes: https://github.com/searxng/searxng/issues/4245 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
36a1ef1239
commit
906b9e7d4c
4 changed files with 10 additions and 5 deletions
|
@ -116,6 +116,10 @@ class Translations(BaseAnswer, kw_only=True):
|
|||
translations: list[Translations.Item]
|
||||
"""List of translations."""
|
||||
|
||||
def __post_init__(self):
|
||||
if not self.translations:
|
||||
raise ValueError("Translation does not have an item in the list translations")
|
||||
|
||||
class Item(msgspec.Struct, kw_only=True):
|
||||
"""A single element of the translations / a translation. A translation
|
||||
consists of at least a mandatory ``text`` property (the translation) ,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue