Showing
1 changed file
with
7 additions
and
2 deletions
@@ -126,15 +126,20 @@ public class DeliveryMinutesService { | @@ -126,15 +126,20 @@ 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()){ | 129 | + TimeUnit timeUnit; |
130 | + if (Objects.nonNull(timeUnit=limitTime.getTimeUnit())) { | ||
131 | + switch (timeUnit) { | ||
130 | case HOURS: | 132 | case HOURS: |
131 | default: | 133 | default: |
132 | - minutes = limitTime.getLimitTime()*60; | 134 | + minutes = limitTime.getLimitTime() * 60; |
133 | break; | 135 | break; |
134 | case MINUTES: | 136 | case MINUTES: |
135 | minutes = limitTime.getLimitTime(); | 137 | minutes = limitTime.getLimitTime(); |
136 | break; | 138 | break; |
137 | } | 139 | } |
140 | + }else{ | ||
141 | + minutes = limitTime.getLimitTime() * 60; | ||
142 | + } | ||
138 | return minutes; | 143 | return minutes; |
139 | } | 144 | } |
140 | 145 |
-
Please register or login to post a comment