[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[snapshot/master] Handle absence of file information for a particular hash while sorting



---
 web/app/snapshot/controllers/package.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/web/app/snapshot/controllers/package.py b/web/app/snapshot/controllers/package.py
index d029a7e..139761f 100644
--- a/web/app/snapshot/controllers/package.py
+++ b/web/app/snapshot/controllers/package.py
@@ -173,7 +173,7 @@ class PackageController(BaseController):
                     fi['dirlink'] = build_url_archive(fi['archive_name'], fi['run'], fi['path'])
                     fi['link'] = build_url_archive(fi['archive_name'], fi['run'], os.path.join(fi['path'], fi['name']), isadir=False )
 
-            sourcefiles.sort(key=lambda a: (fileinfo[a][0]['name'], a)) # reproducible file order
+            sourcefiles.sort(key=lambda a: (fileinfo[a][0]['name'], a) if len(fileinfo[a]) > 0 else (None,a)) # reproducible file order
 
             c.src = source
             c.version = version
-- 
1.7.2.3


Reply to: