diff --git a/fanficdownloader/htmlheuristics.py b/fanficdownloader/htmlheuristics.py
index c16d5cc..52a78df 100644
--- a/fanficdownloader/htmlheuristics.py
+++ b/fanficdownloader/htmlheuristics.py
@@ -137,6 +137,9 @@ def replace_br_with_p(body):
contentLinesSum += lineLen
if lineLen > longestLineLength:
longestLineLength = lineLen
+
+ if contentLines == 0:
+ contentLines = 1
averageLineLength = contentLinesSum/contentLines