From 993837e571a6fffbf7f769a4f1281c3eb103a116 Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Mon, 13 Jan 2025 12:33:50 -0500 Subject: [PATCH] Add another layer to this error for clickable stack --- .../samples/petclinic/owner/PetController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java index 78339e9..9c6e98c 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -60,9 +60,7 @@ public Collection populatePetTypes() { public Owner findOwner(@PathVariable("ownerId") int ownerId) { Owner owner = this.owners.findById(ownerId); - if (owner == null) { - throw new IllegalArgumentException("Owner ID not found: " + ownerId); - } + ControllerValidation.ValidateNotNull(owner, "Owner"); return owner; }