diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java index 794b198e..12b61664 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java @@ -228,7 +228,7 @@ public class MenuServiceImpl extends ServiceImpl implements IM } if (menu.getParentId() != null && menu.getId() == null) { Menu parentMenu = baseMapper.selectById(menu.getParentId()); - if (parentMenu.getCategory() != 1) { + if (parentMenu != null && parentMenu.getCategory() != 1) { throw new ServiceException("父节点只可选择菜单类型!"); } }