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 4a01056f Allow for empty YAML file
4a01056f is described below

commit 4a01056fb12b69c998c2fb609a1a5cfa85ef171e
Author: Sebb <[email protected]>
AuthorDate: Tue Aug 6 11:00:37 2024 +0100

    Allow for empty YAML file
---
 www/secretary/workbench/views/index.json.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/secretary/workbench/views/index.json.rb 
b/www/secretary/workbench/views/index.json.rb
index d53f2dc7..d6f1ddae 100644
--- a/www/secretary/workbench/views/index.json.rb
+++ b/www/secretary/workbench/views/index.json.rb
@@ -9,7 +9,7 @@ if index
 
   if index > 0
     prevmbox = available[index-1]
-    prevmbox = nil unless YAML.load_file(prevmbox).any? do |key, mail|
+    prevmbox = nil unless YAML.load_file(prevmbox)&.any? do |key, mail|
       mail[:status] != :deleted and not Message.attachments(mail).empty?
     end
   end

Reply via email to