diff --git a/src/main/java/vn/webapp/backend/auction/service/bid/AuctionHistoryServiceImpl.java b/src/main/java/vn/webapp/backend/auction/service/bid/AuctionHistoryServiceImpl.java index cbaed3c..04c645f 100644 --- a/src/main/java/vn/webapp/backend/auction/service/bid/AuctionHistoryServiceImpl.java +++ b/src/main/java/vn/webapp/backend/auction/service/bid/AuctionHistoryServiceImpl.java @@ -129,7 +129,7 @@ public void deleteBidByUserAndAuction(Integer userId, Integer auctionId, String List lastActiveBids = auctionHistoryRepository.findLastActiveBidByAuctionId(auctionId); if (!lastActiveBids.isEmpty()) { AuctionHistory lastActiveBid = lastActiveBids.get(0); - if (lastActiveBid.getPriceGiven() < auction.getJewelry().getBuyNowPrice()) { + if (lastActiveBid.getPriceGiven() < auction.getJewelry().getBuyNowPrice() && auction.getEndDateStored() != null) { auction.setEndDate(auction.getEndDateStored()); } auction.setLastPrice(lastActiveBid.getPriceGiven());