summaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
authorryanss2015-06-28 08:16:57 -0400
committerryanss2015-06-28 08:16:57 -0400
commit3d0c42d0112fcc2026ab4f805b93b4d8b0405718 (patch)
tree657746bc412fa73b53aa78f6021abc8294f72deb /ftplugin
parenta78e2f32181fc7a0c24ebf12f939c2fd9b6a5770 (diff)
downloadvim-hn-3d0c42d0112fcc2026ab4f805b93b4d8b0405718.tar.gz
Fix exception caused by comment items without content
Example [9772426]
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/hackernews.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ftplugin/hackernews.py b/ftplugin/hackernews.py
index 97205d1..86b16bf 100644
--- a/ftplugin/hackernews.py
+++ b/ftplugin/hackernews.py
@@ -267,6 +267,10 @@ def print_comments(comments, level=0):
bwrite("%sComment by %s %s: [%s]"
% (" "*level*4, comment.get('user', '???'),
comment['time_ago'], comment['id']))
+ if not comment.get('content', False):
+ bwrite("")
+ bwrite("")
+ continue
for p in comment['content'].split("<p>"):
if not p:
continue