src/cm/utils/comment_positioning.py
changeset 308 3b92edaa5291
parent 290 757202d3ed11
child 360 bfaab8740995
--- 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 = ""