Showing
1 changed file
with
13 additions
and
8 deletions
@@ -126,14 +126,19 @@ public class DeliveryMinutesService { | @@ -126,14 +126,19 @@ public class DeliveryMinutesService { | ||
126 | 126 | ||
127 | private static int getMinutes(LimitTime limitTime){ | 127 | private static int getMinutes(LimitTime limitTime){ |
128 | int minutes; | 128 | int minutes; |
129 | - switch (limitTime.getTimeUnit()){ | ||
130 | - case HOURS: | ||
131 | - default: | ||
132 | - minutes = limitTime.getLimitTime()*60; | ||
133 | - break; | ||
134 | - case MINUTES: | ||
135 | - minutes = limitTime.getLimitTime(); | ||
136 | - break; | 129 | + TimeUnit timeUnit; |
130 | + if (Objects.nonNull(timeUnit=limitTime.getTimeUnit())) { | ||
131 | + switch (timeUnit) { | ||
132 | + case HOURS: | ||
133 | + default: | ||
134 | + minutes = limitTime.getLimitTime() * 60; | ||
135 | + break; | ||
136 | + case MINUTES: | ||
137 | + minutes = limitTime.getLimitTime(); | ||
138 | + break; | ||
139 | + } | ||
140 | + }else{ | ||
141 | + minutes = limitTime.getLimitTime() * 60; | ||
137 | } | 142 | } |
138 | return minutes; | 143 | return minutes; |
139 | } | 144 | } |
-
Please register or login to post a comment