From 2b3cecf55d1b67c239003f3565f784f4d139d48c Mon Sep 17 00:00:00 2001 From: s-choi Date: Fri, 25 Sep 2026 15:14:39 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20=E7=9B=AE=E6=A8=99=E3=81=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E4=BA=BA=E3=81=AF=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TransactionController.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java b/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java index 50addac..a6baff2 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java @@ -378,34 +378,24 @@ public class TransactionController { List resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0) .collect(Collectors.toList()); - GoalForm result = new GoalForm(); - - if (resultList.getFirst() != null) { - result = resultList.getFirst(); + + if (!resultList.isEmpty()) { + GoalForm result = resultList.getFirst(); + model.addAttribute("achievementRate", result.getAchievementRate()); - model.addAttribute("currentAmount", result.getCurrentAmount()); - model.addAttribute("targetAmount", result.getTargetAmount()); - model.addAttribute("saving", userForm.getSaving()); - model.addAttribute("deadline", result.getDeadline()); } else { model.addAttribute("achievementRate", "目標を設定してください"); - model.addAttribute("currentAmount", "目標を設定してください"); - model.addAttribute("targetAmount", "目標を設定してください"); - model.addAttribute("saving", userForm.getSaving()); - model.addAttribute("deadline", "目標を設定してください"); - } - return "menu"; }