mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-05-03 05:13:57 -04:00
check whether metadata file is a duplicate before parsing it
By checking first, this prevents a stacktrace when the duplicate metadata file is not valid. For example, in the tests, the duplicate is just a zero length file, which was causing a stacktrace.
This commit is contained in:
@@ -783,9 +783,10 @@ def read_metadata(xref=True):
|
||||
+ glob.glob('.fdroid.json')
|
||||
+ glob.glob('.fdroid.xml')
|
||||
+ glob.glob('.fdroid.yml')):
|
||||
packageName, _ = fdroidserver.common.get_extension(os.path.basename(metadatapath))
|
||||
if packageName in apps:
|
||||
raise MetaDataException("Found multiple metadata files for " + packageName)
|
||||
app = parse_metadata(metadatapath)
|
||||
if app.id in apps:
|
||||
raise MetaDataException("Found multiple metadata files for " + app.id)
|
||||
check_metadata(app)
|
||||
apps[app.id] = app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user