From 6fdeb7096b464a34d81c43b45ad90559491ed638 Mon Sep 17 00:00:00 2001 From: dev01 Date: Mon, 26 Dec 2022 14:36:24 +0800 Subject: [PATCH] =?UTF-8?q?[Backend]=20=E4=BF=AE=E5=BE=A9=20SaveDeviceKind?= =?UTF-8?q?=20=E4=B8=8A=E5=82=B3=E5=9C=96=E7=89=87=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/DeviceManageController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index 2f9aca4..64e9bed 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -1281,7 +1281,9 @@ namespace Backend.Controllers { //刪除原本的檔案 FolderFunction folderFunction = new FolderFunction(); - folderFunction.DeleteFile(Path.Combine(deviceKindFileSaveAsPath, deviceKind.Device_image)); + if (deviceKind.Device_image != null) { + folderFunction.DeleteFile(Path.Combine(deviceKindFileSaveAsPath, deviceKind.Device_image)); + } var split = post.Device_image_file.FileName.Split("."); var fileName = image_guid + "." + split[split.Length - 1];