fix(menu): 解决菜单父ID为空时的空指针异常

- 在比较父菜单ID前添加非空检查
- 防止当菜单记录的parentId字段为null时发生NullPointerException
- 确保菜单树构建逻辑的稳定性
This commit is contained in:
LWH
2026-03-18 17:05:20 +08:00
parent d51d3213fc
commit 2337e6ae5e
9 changed files with 100 additions and 46 deletions

View File

@@ -526,7 +526,7 @@ public class SysMenuServiceImpl implements ISysMenuService
while (it.hasNext())
{
SysMenu n = (SysMenu) it.next();
if (n.getParentId().longValue() == t.getMenuId().longValue())
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getMenuId().longValue())
{
tlist.add(n);
}