Fix null reference for CheckIn and CheckOut location names in LeaveController
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m21s

This commit is contained in:
Suphonchai Phoonsawat 2026-01-29 10:07:29 +07:00
parent 90eb94cee3
commit 4c189fdc4a

View file

@ -1462,7 +1462,7 @@ namespace BMA.EHR.Leave.Service.Controllers
"LATE" : "LATE" :
"NORMAL", "NORMAL",
CheckInIsLocation = d.IsLocationCheckIn, CheckInIsLocation = d.IsLocationCheckIn,
CheckInLocationName = d.CheckInLocationName, CheckInLocationName = d.CheckInLocationName ?? "",
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date, CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm:ss"), CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm:ss"),
CheckOutLocation = d.CheckOutPOI ?? "", CheckOutLocation = d.CheckOutPOI ?? "",
@ -1477,7 +1477,7 @@ namespace BMA.EHR.Leave.Service.Controllers
"NORMAL", "NORMAL",
CheckOutIsLocation = d.IsLocationCheckOut, CheckOutIsLocation = d.IsLocationCheckOut,
CheckOutLocationName = d.CheckOutLocationName, CheckOutLocationName = d.CheckOutLocationName ?? "",
IsEdit = _processUserTimeStampRepository.IsEditRequest(userId, d.CheckIn.Date) IsEdit = _processUserTimeStampRepository.IsEditRequest(userId, d.CheckIn.Date)