Skip to content

Commit

Permalink
fix page crash on corrupted levelstring file
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jul 21, 2024
1 parent 62135f5 commit 19f727e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions history/templatetags/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

@register.simple_tag
def print_file_size(size):
if size is None: return "Corrupted"

size_KB = size / 1024
size_MB = size_KB / 1024
if size_MB > 1: return f"{size_MB:.2f} MB"
Expand Down

0 comments on commit 19f727e

Please sign in to comment.