validate extension earlier

Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
This commit is contained in:
Jakub Trllo 2025-06-06 17:03:25 +02:00 committed by GitHub
parent 688e5f2104
commit da1a39ed6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -539,12 +539,13 @@ class IWorkfileHost:
items = []
for filename in filenames:
filepath = os.path.join(workdir, filename)
# TODO add 'default' support for folders
ext = os.path.splitext(filepath)[1].lower()
ext = os.path.splitext(filename)[1].lower()
if ext not in extensions:
continue
filepath = os.path.join(workdir, filename)
rootless_path = f"{rootless_workdir}/{filename}"
workfile_entity = workfile_entities_by_path.pop(
rootless_path, None