diff --git a/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java b/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java index f4a0658..375a64e 100644 --- a/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java +++ b/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java @@ -164,10 +164,11 @@ private boolean isEqualUserAndParticipantUser(User user, User participantUser) { } private int getValidatedResult(User user) { - try { - return user.getResult().getNumResult(); - } catch (NullPointerException e) { + if (user.getResult() == null) { return -1; } + else { + return user.getResult().getNumResult(); + } } } diff --git a/doorip-domain/src/main/java/org/doorip/user/domain/Result.java b/doorip-domain/src/main/java/org/doorip/user/domain/Result.java index 286e2d0..345dda9 100644 --- a/doorip-domain/src/main/java/org/doorip/user/domain/Result.java +++ b/doorip-domain/src/main/java/org/doorip/user/domain/Result.java @@ -20,7 +20,7 @@ public enum Result { AEP(6, "AEP"), AEI(7, "AEI"); - private final int numResult; + private final Integer numResult; private final String stringResult; public static Result getEnumResultFromStringResult(String stringResult) {