do not try to us comment if detached
authorraph
Mon, 23 Aug 2010 17:19:35 +0200
changeset 308 3b92edaa5291
parent 307 0cf1d1fc084c
child 309 48f59ae7c992
do not try to us comment if detached
src/cm/utils/comment_positioning.py
--- a/src/cm/utils/comment_positioning.py	Thu Aug 19 13:19:24 2010 +0200
+++ b/src/cm/utils/comment_positioning.py	Mon Aug 23 17:19:35 2010 +0200
@@ -182,9 +182,10 @@
         start_color = wrapper_data['start_color']
         offsets = sorted(wrapper_data['offsets'].items(), key=operator.itemgetter(0))
 
-        # TODO: html.find(id = "sv-%d"%wrapper_id) is None (?) when comment detached
-        
-        content = html.find(id = "sv-%d"%wrapper_id).contents[0]
+        d = html.find(id = "sv-%d"%wrapper_id)
+        if not d: # comment detached
+            continue
+        content = d.contents[0]
         
         spans = ""