Skip to content

Commit

Permalink
npe fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Apr 9, 2024
1 parent 5f75eef commit 493cdf6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public boolean isInsertDefaultBackBreadcrumb() {
}

public void addMenuItem(MenuItem menuItem) {
if (SecurityUtils.isMenuAuthorized(menuItem)) {
if (menuItem != null && SecurityUtils.isMenuAuthorized(menuItem)) {
getItems().add(menuItem);
}
}

public void addMenuItemAtIndex(MenuItem menuItem, int position) {
if (SecurityUtils.isMenuAuthorized(menuItem)) {
if (menuItem != null && SecurityUtils.isMenuAuthorized(menuItem)) {
if (getItems().size() >= position) {
getItems().add(position, menuItem);
}else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static boolean isMenuAuthorized(MainMenuItem item) {
return clazz == null || isPageAuthorized(clazz);
}

public static boolean isMenuAuthorized(MenuItem item) {
public static boolean isMenuAuthorized(@NotNull MenuItem item) {
Class<? extends WebPage> clazz = item.getPageClass();
List<String> authz = LeftMenuAuthzUtil.getAuthorizationsForPage(clazz);
if (CollectionUtils.isNotEmpty(authz)) {
Expand Down

0 comments on commit 493cdf6

Please sign in to comment.