From bb57b8711a3d36346e8e4b365f27aa5c61537040 Mon Sep 17 00:00:00 2001 From: xiaolipro <2357729423@qq.com> Date: Tue, 24 Sep 2024 16:42:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=B7=BB=E5=8A=A0=E6=A8=A1?= =?UTF-8?q?=E7=89=88=E5=AD=98=E5=9C=A8=E6=80=A7=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackTemplates/TrackTemplateService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs index 429fb440..9dfc58bd 100644 --- a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs +++ b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs @@ -259,6 +259,11 @@ public class TrackTemplateService : ApplicationService #endregion 业务校验 var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id); + if (templateEntity == null) + { + throw new BusinessException(message: "模版不存在"); + } + ObjectMapper.Map(input, templateEntity); var isTrue = await _trackTemplateRepository.UpdateAsync(templateEntity);