From 847ee8ffec21ec3e62e12384308c3820064e11bd Mon Sep 17 00:00:00 2001 From: Kevin Steck Date: Tue, 8 Oct 2013 16:34:26 -0400 Subject: [PATCH] Fixed a bug if the isn't in the first 1kb. --- r2/r2/lib/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/lib/utils/utils.py b/r2/r2/lib/utils/utils.py index 11ef45f5a..6cff348b1 100644 --- a/r2/r2/lib/utils/utils.py +++ b/r2/r2/lib/utils/utils.py @@ -225,7 +225,7 @@ def get_title(url): def extract_title(data): """Tries to extract the value of the title element from a string of HTML""" bs = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES) - if not bs: + if not bs or not bs.html.head: return title_bs = bs.html.head.title