summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorryanss2015-01-08 23:59:00 -0500
committerryanss2015-01-08 23:59:00 -0500
commit13ec2a26c2027a3472558fe073411ac47a3a10d5 (patch)
tree6be6b64bac4121e3bf400f5ac1a0d9bdb3cf26ad /plugin
parent20be9d465429165b4b623c8fb34ccd62a9c10248 (diff)
downloadvim-hn-13ec2a26c2027a3472558fe073411ac47a3a10d5.tar.gz
Handle deleted comments gracefully
Deleted comments do not have a 'user' key
Diffstat (limited to 'plugin')
-rw-r--r--plugin/hackernews.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/hackernews.py b/plugin/hackernews.py
index acbac04..dad0853 100644
--- a/plugin/hackernews.py
+++ b/plugin/hackernews.py
@@ -54,7 +54,7 @@ html = HTMLParser.HTMLParser()
def print_comments(comments, b):
for comment in comments:
level = comment['level']
- b.append("%sComment by %s %s:" % ("\t"*level, comment['user'], comment['time_ago']))
+ b.append("%sComment by %s %s:" % ("\t"*level, comment.get('user','???'), comment['time_ago']))
contents = textwrap.wrap(html.unescape(re.sub('<[^<]+?>', '', comment['content'])),
width=80,
initial_indent=" "*4*level,