From 2d8429e4cb6e98c4b5fa011cad182f5d174b1628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Fri, 21 Jul 2023 11:45:04 +0200 Subject: [PATCH] Update lib/ProductOpener/Mail.pm Co-authored-by: Alex Garel --- lib/ProductOpener/Mail.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ProductOpener/Mail.pm b/lib/ProductOpener/Mail.pm index 09db8dac4521d..2c0322fd2a000 100644 --- a/lib/ProductOpener/Mail.pm +++ b/lib/ProductOpener/Mail.pm @@ -225,7 +225,8 @@ sub get_html_email_content ($filename, $lang) { $file = "$data_root/lang/en/emails/$filename"; } - open(my $IN, "<:encoding(UTF-8)", $file); + open(my $IN, "<:encoding(UTF-8)", $file) or log->error("Can't open $file for reading"); + return unless $IN; my $html = join('', (<$IN>)); close($IN); return $html;