Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] fix crash during poll if Maildir has been emptied
@ 2010-07-08 15:26 Sascha Silbe
  2010-07-13  2:19 ` Rich Lane
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Silbe @ 2010-07-08 15:26 UTC (permalink / raw)
  To: sup-devel

We need to do the rescan in start_offset instead of end_offset so that
end_offset won't be called if the Maildir is empty after the rescan.

Fixes this crash:

NoMethodError from thread: user-invoked poll
undefined method `+' for nil:NilClass
/home/sascha.silbe/src/sup/lib/sup/maildir.rb:171:in `end_offset'
/home/sascha.silbe/src/sup/lib/sup/source.rb:90:in `done?'
[...]

Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
---
 lib/sup/maildir.rb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
index ef3b318..0b2fd5e 100644
--- a/lib/sup/maildir.rb
+++ b/lib/sup/maildir.rb
@@ -162,12 +162,12 @@ class Maildir < Source
   end
 
   def start_offset
-    scan_mailbox
+    scan_mailbox :rescan => true
     @ids.first
   end
 
   def end_offset
-    scan_mailbox :rescan => true
+    scan_mailbox
     @ids.last + 1
   end
 
-- 
1.7.1

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sup-devel] [PATCH] fix crash during poll if Maildir has been emptied
  2010-07-08 15:26 [sup-devel] [PATCH] fix crash during poll if Maildir has been emptied Sascha Silbe
@ 2010-07-13  2:19 ` Rich Lane
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Lane @ 2010-07-13  2:19 UTC (permalink / raw)
  To: Sascha Silbe; +Cc: sup-devel

I'm going to be merging the source rewrite into master soon, so 
this patch won't apply. I'll make sure empty maildirs work.
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-13  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-08 15:26 [sup-devel] [PATCH] fix crash during poll if Maildir has been emptied Sascha Silbe
2010-07-13  2:19 ` Rich Lane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox