From 18a731a3dc66f6609650723de464450e883e23ee Mon Sep 17 00:00:00 2001 From: dabin <113006964+dabinHam@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:51:24 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=B6=A9=EC=A0=84=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=98=A4=EB=A5=98=EB=B0=9C=EC=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 조회결과 없는경우 new payMoney 객체생성시 초기화가 안된부분 nullPointException 발생 --- .../github/commerce/service/payment/ChargeHistoryService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/github/commerce/service/payment/ChargeHistoryService.java b/src/main/java/com/github/commerce/service/payment/ChargeHistoryService.java index 96943c3..59e9671 100644 --- a/src/main/java/com/github/commerce/service/payment/ChargeHistoryService.java +++ b/src/main/java/com/github/commerce/service/payment/ChargeHistoryService.java @@ -35,6 +35,8 @@ public ChargeDto.ChargeResponse chargePayMoney(Long userId, ChargeDto.ChargeRequ // 조회된 결과가 없는 경우, 새로운 PayMoney 객체 생성 PayMoney newPayMoney = new PayMoney(); newPayMoney.setUsers(user); // 사용자 ID 설정 등 다른 필요한 초기화 작업 수행 + newPayMoney.setChargePayMoneyTotal(0L); // 초기값 설정 + newPayMoney.setPayMoneyBalance(0L); // 초기값 설정 return payMoneyRepository.save(newPayMoney); });