From 5001219695090d4a6ead73b2d17434b0805516a3 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 2 Feb 2022 18:34:32 +0300 Subject: Do not delete template path on registry key if cancel pick template dialog --- src/AddIn/RegistryUtil.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/AddIn/RegistryUtil.cs') diff --git a/src/AddIn/RegistryUtil.cs b/src/AddIn/RegistryUtil.cs index dabd74d..5fe2eea 100644 --- a/src/AddIn/RegistryUtil.cs +++ b/src/AddIn/RegistryUtil.cs @@ -38,6 +38,12 @@ namespace RehauSku if (result == DialogResult.OK) { string fileName = Dialog.GetFilePath(); + + if (string.IsNullOrEmpty(fileName)) + { + throw new Exception("Нет файла шаблона"); + } + priceListPath = fileName; RootKey.SetValue("PriceListPath", fileName); return priceListPath; -- cgit v1.2.3