diff --git a/kbazaar/src/main/java/com/kampus/kbazaar/cartitem/CartItemService.java b/kbazaar/src/main/java/com/kampus/kbazaar/cartitem/CartItemService.java index ae1518b..fe05ea3 100644 --- a/kbazaar/src/main/java/com/kampus/kbazaar/cartitem/CartItemService.java +++ b/kbazaar/src/main/java/com/kampus/kbazaar/cartitem/CartItemService.java @@ -25,7 +25,8 @@ public CartItemService(CartItemRepository cartItemRepository, CartRepository car public CartResponse getCartByUsername(String username) { Optional optionalCartResponse = cartRepository.getCartByUsername(username); - CartResponse cartResponse = new CartResponse(); + new CartResponse(); + CartResponse cartResponse; if (optionalCartResponse.isPresent()) { // get cart cartResponse = optionalCartResponse.get().toResponse();