whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/2] Commit 3ccdab9: handle empty mailbox
Date Mon, 11 Jan 2016 13:09:25 GMT
Commit 3ccdab997a952f73cab9a634fb2507602dab469f:
    handle empty mailbox


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/secmail/server.rb                                        | + -
------------------------------------------------------------
2 changes: 1 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/secmail/server.rb b/www/secmail/server.rb
index 1c55a7d..5b8fe1c 100644
--- a/www/secmail/server.rb
+++ b/www/secmail/server.rb
@@ -16,7 +16,7 @@
 get '/' do
   # determine latest month for which there are messages
   archives = Dir["#{ARCHIVE}/*.yml"].select {|name| name =~ %r{/\d{6}\.yml$}}
-  @mbox = File.basename(archives.sort.last, '.yml')
+  @mbox = archives.empty? ? nil : File.basename(archives.sort.last, '.yml')
   _html :index
 end
 

Mime
View raw message