Commit 97ae1766e8f1d291781f62f25fb76ca5cc16c268
Merge remote-tracking branch 'origin/master-jdk17' into master-jdk17
Showing
1 changed file
with
4 additions
and
1 deletions
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java
| ... | ... | @@ -255,6 +255,9 @@ public class MenuServiceImpl implements MenuService { |
| 255 | 255 | return; |
| 256 | 256 | } |
| 257 | 257 | // 如果 id 为空,说明不用比较是否为相同 id 的菜单 |
| 258 | + if (id == null) { | |
| 259 | + throw exception(MENU_NAME_DUPLICATE); | |
| 260 | + } | |
| 258 | 261 | if (!menu.getId().equals(id)) { |
| 259 | 262 | throw exception(MENU_NAME_DUPLICATE); |
| 260 | 263 | } |
| ... | ... | @@ -277,7 +280,7 @@ public class MenuServiceImpl implements MenuService { |
| 277 | 280 | } |
| 278 | 281 | // 如果 id 为空,说明不用比较是否为相同 id 的菜单 |
| 279 | 282 | if (id == null) { |
| 280 | - return; | |
| 283 | + throw exception(MENU_COMPONENT_NAME_DUPLICATE); | |
| 281 | 284 | } |
| 282 | 285 | if (!menu.getId().equals(id)) { |
| 283 | 286 | throw exception(MENU_COMPONENT_NAME_DUPLICATE); | ... | ... |