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];