From 00570116a2dfba07a9d37ef29c2410ff9446246c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 22 Nov 2022 11:13:49 +0300 Subject: [PATCH] Fix OrderAppService.GetMyOrdersAsync --- .../Orders/OrderAppService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs index 93bcc00c..0ac0dfd8 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs @@ -40,6 +40,11 @@ public class OrderAppService : ApplicationService, IOrderAppService [AllowAnonymous] public async Task> GetMyOrdersAsync(GetMyOrdersInput input) { + if (CurrentUser.Id == null) + { + return new List(); + } + ISpecification specification = SpecificationFactory.Create(input.Filter); var orders = await _orderRepository.GetOrdersByUserId(CurrentUser.GetId(), specification, true); return CreateOrderDtoMapping(orders);