<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -164,14 +164,24 @@ module CelticKnot
         until found_left &amp;&amp; found_right
           unless found_left
             lp2 = segment.left.send(operation)
-            lline = Curves::LineSegment.new(lp1, lp2)
+            if lp2.nil?
+              found_left = :fail
+            else
+              lline = Curves::LineSegment.new(lp1, lp2)
+            end
           end
 
           unless found_right
             rp2 = segment.right.send(operation)
-            rline = Curves::LineSegment.new(rp1, rp2)
+            if rp2.nil?
+              found_right = :fail
+            else
+              rline = Curves::LineSegment.new(rp1, rp2)
+            end
           end
-          
+
+          break if found_left &amp;&amp; found_right
+
           p3 = boundary[0]
           1.upto(boundary.length-1) do |j|
             p4 = boundary[j]
@@ -196,6 +206,8 @@ module CelticKnot
           lp1, rp1 = lp2, rp2
         end
 
+        return if found_left == :fail || found_right == :fail
+
         if found_left &lt; found_right
           lo, hi = found_left, found_right
           collection = segment.left</diff>
      <filename>lib/celtic_knot/knot_shape.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f9e72a9b238f40f3218762273d5f2db969abb3d9</id>
    </parent>
  </parents>
  <author>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </author>
  <url>http://github.com/jamis/celtic_knot/commit/57aa7cd291d3be32e14733e90e6c90603ec292c7</url>
  <id>57aa7cd291d3be32e14733e90e6c90603ec292c7</id>
  <committed-date>2009-06-15T06:42:40-07:00</committed-date>
  <authored-date>2009-06-15T06:42:40-07:00</authored-date>
  <message>don't blow up if the threads overlap due to excessive width</message>
  <tree>d7cdb6d9440cf63028f604d321e5a9865d560c79</tree>
  <committer>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </committer>
</commit>
