X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fsup%2Fthread.rb;h=d395c3588f7274448dc86d2d784ee9021b29c3b0;hb=59f8fc2;hp=99f21dc31a07bfcb3424a1fc206e20133e2ec8ab;hpb=bd87b8e2f494d1a30952b0781f8de20134882ddb;p=sup diff --git a/lib/sup/thread.rb b/lib/sup/thread.rb index 99f21dc..d395c35 100644 --- a/lib/sup/thread.rb +++ b/lib/sup/thread.rb @@ -310,13 +310,15 @@ class ThreadSet private :prune_thread_of def remove_id mid - return unless(c = @messages[mid]) + return unless @messages.member?(mid) + c = @messages[mid] remove_container c prune_thread_of c end def remove_thread_containing_id mid - c = @messages[mid] or return + return unless @messages.member?(mid) + c = @messages[mid] t = c.root.thread @threads.delete_if { |key, thread| t == thread } end @@ -355,7 +357,7 @@ class ThreadSet return if threads.size < 2 containers = threads.map do |t| - c = @messages[t.first.id] + c = @messages.member?(c) ? @messages[t.first.id] : nil raise "not in threadset: #{t.first.id}" unless c && c.message c end