Commit 3ccdab997a952f73cab9a634fb2507602dab469f:
    handle empty mailbox

Branch: refs/heads/master
Author: Sam Ruby <[email protected]>
Committer: Sam Ruby <[email protected]>
Pusher: rubys <[email protected]>

------------------------------------------------------------
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
 

Reply via email to