This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 107c14d  Don't crash if no mbox found
107c14d is described below

commit 107c14db90a134da6a8eae26c666ffdf419d3c53
Author: Sebb <[email protected]>
AuthorDate: Tue Dec 18 19:43:28 2018 +0000

    Don't crash if no mbox found
---
 www/secretary/workbench/server.rb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/www/secretary/workbench/server.rb 
b/www/secretary/workbench/server.rb
index 01d154a..2269853 100644
--- a/www/secretary/workbench/server.rb
+++ b/www/secretary/workbench/server.rb
@@ -55,9 +55,11 @@ get '/' do
   # determine latest month for which there are messages
   archives = Dir[File.join(ARCHIVE, '*.yml')].select {|name| name =~ 
%r{/\d{6}\.yml$}}
   @mbox = archives.empty? ? nil : File.basename(archives.sort.last, '.yml')
-  @mbox = [Date.today.strftime('%Y%m'), @mbox].min if @mbox
-  @messages = Mailbox.new(@mbox).client_headers.select do |message|
-    message[:status] != :deleted
+  if @mbox
+    @mbox = [Date.today.strftime('%Y%m'), @mbox].min
+    @messages = Mailbox.new(@mbox).client_headers.select do |message|
+      message[:status] != :deleted
+    end
   end
 
   @cssmtime = File.mtime('public/secmail.css').to_i

Reply via email to