Mod, QMod: return empty list instead of nothing when there's no author
This commit is contained in:
parent
a757e31cee
commit
d5ebb6dba4
2 changed files with 3 additions and 3 deletions
|
|
@ -48,12 +48,12 @@ class Mod:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def authors(self) -> list[str] | None:
|
def authors(self) -> list[str]:
|
||||||
if self.__has_meta_json:
|
if self.__has_meta_json:
|
||||||
if "authors" in self.__meta:
|
if "authors" in self.__meta:
|
||||||
return self.__meta.get("authors", list[str])
|
return self.__meta.get("authors", list[str])
|
||||||
if "author" not in self.__config:
|
if "author" not in self.__config:
|
||||||
return None
|
return []
|
||||||
return [self.__config.get("author", str)]
|
return [self.__config.get("author", str)]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class QMod(QObject):
|
||||||
return self.__mod.long_description
|
return self.__mod.long_description
|
||||||
|
|
||||||
@Property(list, constant=True)
|
@Property(list, constant=True)
|
||||||
def authors(self) -> list[str] | None:
|
def authors(self) -> list[str]:
|
||||||
return self.__mod.authors
|
return self.__mod.authors
|
||||||
|
|
||||||
mod_enabled = Signal(name="enabled")
|
mod_enabled = Signal(name="enabled")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue