diff --git a/AsbCloudWebApi/Controllers/WellController.cs b/AsbCloudWebApi/Controllers/WellController.cs index 003cf391..4033eead 100644 --- a/AsbCloudWebApi/Controllers/WellController.cs +++ b/AsbCloudWebApi/Controllers/WellController.cs @@ -24,6 +24,11 @@ namespace AsbCloudWebApi.Controllers { var idCustomer = User.GetCustomerId(); + if (idCustomer is null) + { + return NoContent(); + } + var wells = wellService.GetWellsByCustomer((int)idCustomer); return Ok(wells); @@ -33,7 +38,7 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetTransmittingWells() { - int? idCustomer = User.GetCustomerId(); + var idCustomer = User.GetCustomerId(); if(idCustomer is null) {