home · contact · privacy
Fix NoneType bug.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 18 Mar 2016 18:58:46 +0000 (19:58 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 18 Mar 2016 18:58:46 +0000 (19:58 +0100)
plomlombot.py

index 6f6d33994255504e2ac4903cbe254d623db5fbdc..75cfe25344a7bbaf32fa977c944e11ca85362196 100755 (executable)
@@ -323,7 +323,7 @@ def handle_url(url, notice, show_url=False):
     if mobile_twitter_hack(url):
         return
     title = bs4.BeautifulSoup(r.text, "html5lib").title
     if mobile_twitter_hack(url):
         return
     title = bs4.BeautifulSoup(r.text, "html5lib").title
-    if title:
+    if title and title.string:
         prefix = "PAGE TITLE: "
         if show_url:
             prefix = "PAGE TITLE FOR <" + url + ">: "
         prefix = "PAGE TITLE: "
         if show_url:
             prefix = "PAGE TITLE FOR <" + url + ">: "