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 378e3deb Don't fail when parsing empty file
378e3deb is described below

commit 378e3debeedbc7e350de980261929183b00c297a
Author: Sebb <[email protected]>
AuthorDate: Tue Aug 6 00:22:08 2024 +0100

    Don't fail when parsing empty file
---
 www/secretary/workbench/models/mailbox.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/secretary/workbench/models/mailbox.rb 
b/www/secretary/workbench/models/mailbox.rb
index 9a127486..fe0d325c 100644
--- a/www/secretary/workbench/models/mailbox.rb
+++ b/www/secretary/workbench/models/mailbox.rb
@@ -157,8 +157,8 @@ class Mailbox
   # return headers (server view)
   #
   def headers
-    messages = YAML.load_file(yaml_file) rescue {}
-    messages.delete :mtime
+    messages = YAML.load_file(yaml_file) || {} rescue {}
+    messages.delete :mtime # TODO: is this needed?
     messages.each do |_key, value|
       value[:source] = @name
     end

Reply via email to