diff --git a/Winey-API/src/main/java/com/example/wineyapi/tastingNote/convertor/TastingNoteConvertor.java b/Winey-API/src/main/java/com/example/wineyapi/tastingNote/convertor/TastingNoteConvertor.java index 33d34dd..d1dc514 100644 --- a/Winey-API/src/main/java/com/example/wineyapi/tastingNote/convertor/TastingNoteConvertor.java +++ b/Winey-API/src/main/java/com/example/wineyapi/tastingNote/convertor/TastingNoteConvertor.java @@ -86,7 +86,7 @@ public TastingNoteResponse.TasteAnalysisDTO TasteAnalysis(List tast sweetnessSum += tastingNote.getSweetness(); aciditySum += tastingNote.getAcidity(); - alcoholSum += tastingNote.getAlcohol(); + alcoholSum += (tastingNote.getAlcohol() != null ? tastingNote.getAlcohol() : 0); bodySum += tastingNote.getBody(); tanninSum += tastingNote.getTannins(); sparklingSum += tastingNote.getSparkling() != null ? tastingNote.getSparkling() : 0;