backport crash fix if there are no files #6515

This commit is contained in:
Barış Soner Uşaklı
2018-05-18 11:22:24 -04:00
committed by GitHub
parent f2011aafac
commit 12337302a7

View File

@@ -76,7 +76,7 @@ uploadsController.get = function (req, res, next) {
res.render('admin/manage/uploads', {
currentFolder: currentFolder.replace(nconf.get('upload_path'), ''),
showPids: files[0].hasOwnProperty('inPids'),
showPids: files.length && files[0].hasOwnProperty('inPids'),
files: files,
breadcrumbs: buildBreadcrumbs(currentFolder),
pagination: pagination.create(page, Math.ceil(itemCount / itemsPerPage), req.query),