From 676d58abe21588e35d46006cb0a68db6012d35f0 Mon Sep 17 00:00:00 2001 From: idzuibenko Date: Tue, 28 Sep 2021 10:35:55 +0300 Subject: [PATCH] added error check in case of missing template files --- pym/calculate/lib/cl_template.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pym/calculate/lib/cl_template.py b/pym/calculate/lib/cl_template.py index 931ec76..bb51e23 100644 --- a/pym/calculate/lib/cl_template.py +++ b/pym/calculate/lib/cl_template.py @@ -6023,6 +6023,10 @@ gettext -d cl_template "$*" # Выполняем условия для блока текста а так-же заменяем переменные self.nameFileTemplate = os.path.abspath(nameFileTemplate) self.F_TEMPL = self.openTemplFile(self.nameFileTemplate) + if self.F_TEMPL == False: + self.setError(_("Failed to open the file") + _(": ") + + self.nameFileTemplate) + return [] origTextTemplate, file_is_unicode = try_decode_utf8(self.F_TEMPL.read()) self.textTemplate = origTextTemplate self.configMode = T_ORIGIN