From b17347c166e2793c7db4ece2b5e49a46c72425a2 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 4 Feb 2014 19:53:05 +0100 Subject: [PATCH] Bugfix --- convert.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/convert.py b/convert.py index 6ec4d14..af27159 100644 --- a/convert.py +++ b/convert.py @@ -70,7 +70,11 @@ print "Parsing XML..." for item in xml.xpath("/rss/channel/item"): post_type = item.xpath("wp:post_type/text()", namespaces=xmlns)[0] - post_title = item.xpath("title/text()", namespaces=xmlns)[0] + + try: + post_title = item.xpath("title/text()", namespaces=xmlns)[0] + except IndexError, e: + post_title = "Untitled" try: post_slug = item.xpath("wp:post_name/text()", namespaces=xmlns)[0]