From 4ce676fcb326ee8d6372a0c720fea75f57e998ae Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 28 Oct 2023 02:45:48 +0200 Subject: [PATCH] fix: broke when missing index.html --- fcp3/sitemgr.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fcp3/sitemgr.py b/fcp3/sitemgr.py index ff590db..c130e86 100644 --- a/fcp3/sitemgr.py +++ b/fcp3/sitemgr.py @@ -1439,9 +1439,10 @@ def markManifestFiles(self): maxsize = self.maxManifestSizeBytes - redirectSize * len(self.files) totalsize = metadataSize # we add the index as first file, so it is always fast. - self.indexRec['target'] = "manifest" - totalsize += self.indexRec['sizebytes'] - maxsize += redirectSize # no redirect needed for this file + if self.indexRec: + self.indexRec['target'] = "manifest" + totalsize += self.indexRec['sizebytes'] + maxsize += redirectSize # no redirect needed for this file # also we always add the activelink if self.activelinkRec and (self.activelinkRec['sizebytes'] + totalsize <= maxsize + redirectSize):