Skip to content

Commit

Permalink
MenuNode: tolerate AD_Menu_ID=0
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Jun 9, 2017
1 parent 559cc96 commit 76a3c3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/de/metas/ui/web/menu/MenuNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public boolean isMatchedByFilter()

public static final class Builder
{
private int adMenuId;
private int adMenuId = -1;

private String caption;
private String captionBreadcrumb;
Expand Down Expand Up @@ -352,7 +352,9 @@ public Builder setAD_Menu_ID(final int adMenuId)

private int getAD_Menu_ID()
{
if (adMenuId <= 0)
// NOTE: tolerate adMenuId=0 because there are some case in old API where we have a MTreeNode with Node_ID=0 (usually the root)
// see https://github.com/metasfresh/metasfresh-webui-api/issues/446
if (adMenuId < 0)
{
throw new AdempiereException("AD_Menu_ID not set");
}
Expand Down

0 comments on commit 76a3c3a

Please sign in to comment.