diff --git a/src/main/java/com/maradona/backend/controllers/page/SkillsPage.java b/src/main/java/com/maradona/backend/controllers/page/SkillsPage.java index 3b298d3..207c98b 100644 --- a/src/main/java/com/maradona/backend/controllers/page/SkillsPage.java +++ b/src/main/java/com/maradona/backend/controllers/page/SkillsPage.java @@ -52,7 +52,11 @@ public class SkillsPage { */ @GetMapping({ "/", "" }) public String profile(Model model) { - model.addAttribute("employee", employeeDetails.getEmployeeByEid(user).orElse(null)); + var employee = employeeDetails.getEmployeeByEid(user).orElse(null); + if (employee == null) { + return "/404"; + } + model.addAttribute("employee", employee); model.addAttribute("skills", skillService.getUserSkills(user)); return "/pages/skills/overview"; } diff --git a/src/main/java/com/maradona/backend/entities/Employee.java b/src/main/java/com/maradona/backend/entities/Employee.java index 9c85ae0..5cf719e 100644 --- a/src/main/java/com/maradona/backend/entities/Employee.java +++ b/src/main/java/com/maradona/backend/entities/Employee.java @@ -24,7 +24,7 @@ public class Employee { private String lastName; @ManyToOne - @JoinColumn(name = "FID", referencedColumnName = "fid") + @JoinColumn(name = "fid") private FormOfAddress formOfAddress; private LocalTime dStart;