Fakultas Ilmu Komputer UI

Commit 9f17fa81 authored by WINALDO AMADEA HESTU's avatar WINALDO AMADEA HESTU
Browse files

fix null bug

parent 65454c75
Pipeline #134479 passed with stages
in 14 minutes and 40 seconds
......@@ -39,10 +39,16 @@ public class PaymentController {
@GetMapping(path="/payment-methods")
public String paymentList(Model model, Principal principal){
String user;
if (principal != null) {
user = principal.getName();
} else {
user = "";
}
paymentService.getUserPayments();
model.addAttribute("username", (principal != null) ? principal.getName() : "");
model.addAttribute("username",user);
model.addAttribute("payments", paymentService.getUserPayments());
model.addAttribute("user", userService.getUserByName(principal.getName()));
model.addAttribute("user", userService.getUserByName(user));
return "payment-methods";
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment