misc: do not include file contents in json export if file is not set (#89876)
gitea/wcs/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2024-04-22 16:30:02 +02:00
parent 22f8886b9d
commit 0fcf440e0a
1 changed files with 1 additions and 1 deletions

View File

@ -418,7 +418,7 @@ class AttachmentEvolutionPart(EvolutionPart):
return os.path.join(get_publisher().app_dir, self.filename)
def get_file_pointer(self):
if self.filename.startswith('uuid-'):
if not self.filename or self.filename.startswith('uuid-'):
return None
return open(self.get_file_path(), 'rb') # pylint: disable=consider-using-with