added null check for Parent_ID element.
This commit is contained in:
parent
7d4f9afb08
commit
cc04468c7d
|
@ -106,12 +106,14 @@ public class MenuElementHandler extends AbstractElementHandler {
|
||||||
|
|
||||||
Element parentElement = element.properties.get("Parent_ID");
|
Element parentElement = element.properties.get("Parent_ID");
|
||||||
int parentId = 0;
|
int parentId = 0;
|
||||||
|
if (parentElement != null) {
|
||||||
if (ReferenceUtils.isIDLookup(parentElement) || ReferenceUtils.isUUIDLookup(parentElement)) {
|
if (ReferenceUtils.isIDLookup(parentElement) || ReferenceUtils.isUUIDLookup(parentElement)) {
|
||||||
parentId = ReferenceUtils.resolveReference(ctx, parentElement);
|
parentId = ReferenceUtils.resolveReference(ctx, parentElement);
|
||||||
} else {
|
} else {
|
||||||
String parent = getStringValue(element, "Parent_ID");
|
String parent = getStringValue(element, "Parent_ID");
|
||||||
parentId = findIdByName(ctx, "AD_Menu", parent);
|
parentId = findIdByName(ctx, "AD_Menu", parent);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StringBuffer updateSQL = null;
|
StringBuffer updateSQL = null;
|
||||||
String sql = "SELECT count(Parent_ID) FROM AD_TREENODEMM WHERE AD_Tree_ID = 10"
|
String sql = "SELECT count(Parent_ID) FROM AD_TREENODEMM WHERE AD_Tree_ID = 10"
|
||||||
|
|
Loading…
Reference in New Issue