Skip to content

Commit

Permalink
Make sure toc exists in content before calling get_toc
Browse files Browse the repository at this point in the history
Signed-off-by: joseph-sentry <[email protected]>
  • Loading branch information
joseph-sentry committed Jul 16, 2023
1 parent 0bf5dc2 commit 928d011
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/report/parser/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ def size(self):

def content(self) -> BytesIO:
buffer = BytesIO()
for file in self.get_toc():
buffer.write(f"{file}\n".encode("utf-8"))
buffer.write("<<<<<< network\n\n".encode("utf-8"))
if self.has_toc():
for file in self.get_toc():
buffer.write(f"{file}\n".encode("utf-8"))
buffer.write("<<<<<< network\n\n".encode("utf-8"))
for file in self.uploaded_files:
buffer.write(f"# path={file.filename}\n".encode("utf-8"))
buffer.write(file.contents)
Expand Down

0 comments on commit 928d011

Please sign in to comment.