From 037fae1f90797605e0d6391db6c94b3243da2aac Mon Sep 17 00:00:00 2001 From: kmebin Date: Thu, 30 Nov 2023 16:59:05 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B2=8C=EB=A0=88=20=EA=B0=9C=EC=88=98?= =?UTF-8?q?=EA=B0=80=200=EC=9D=BC=20=EB=95=8C=20early=20return=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moabam/api/application/bug/BugService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/moabam/api/application/bug/BugService.java b/src/main/java/com/moabam/api/application/bug/BugService.java index f06401e8..f1246d45 100644 --- a/src/main/java/com/moabam/api/application/bug/BugService.java +++ b/src/main/java/com/moabam/api/application/bug/BugService.java @@ -80,6 +80,10 @@ public PurchaseProductResponse purchaseBugProduct(Long memberId, Long productId, @Transactional public void use(Member member, BugType bugType, int count) { + if (count == 0) { + return; + } + Bug bug = member.getBug(); bug.use(bugType, count); @@ -88,6 +92,10 @@ public void use(Member member, BugType bugType, int count) { @Transactional public void reward(Member member, BugType bugType, int count) { + if (count == 0) { + return; + } + Bug bug = member.getBug(); bug.increase(bugType, count); @@ -104,6 +112,10 @@ public void charge(Long memberId, Product bugProduct) { @Transactional public void applyCoupon(Long memberId, BugType bugType, int count) { + if (count == 0) { + return; + } + Bug bug = getByMemberId(memberId); bug.increase(bugType, count);