From 6b5e6840aa5bc802e48ce6bad7e0e4199c771c30 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 29 May 2018 16:13:30 +0200 Subject: [PATCH] IDEMPIERE-731 Deactivating a node could impact proceeding / IDEMPIERE-1137 NPE in Form "WorkFlow Editor" --- org.adempiere.base/src/org/compiere/wf/MWFNode.java | 3 ++- org.adempiere.base/src/org/compiere/wf/MWorkflow.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/wf/MWFNode.java b/org.adempiere.base/src/org/compiere/wf/MWFNode.java index 34c1824201..042b441174 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFNode.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFNode.java @@ -186,7 +186,8 @@ public class MWFNode extends X_AD_WF_Node */ private void loadNext() { - m_next = new Query(getCtx(), MWFNodeNext.Table_Name, "AD_WF_Node_ID=?", get_TrxName()) + m_next = new Query(getCtx(), MWFNodeNext.Table_Name, "AD_WF_NodeNext.AD_WF_Node_ID=?", get_TrxName()) + .addJoinClause(" JOIN AD_WF_Node ON (AD_WF_Node.AD_WF_Node_ID=AD_WF_NodeNext.AD_WF_Next_ID AND AD_WF_Node.IsActive='Y')") .setParameters(new Object[]{get_ID()}) .setOnlyActiveRecords(true) .setOrderBy(MWFNodeNext.COLUMNNAME_SeqNo) diff --git a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java index 0d1577b623..5583fc6935 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java +++ b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java @@ -435,7 +435,7 @@ public class MWorkflow extends X_AD_Workflow for (int i = 0; i < nexts.length; i++) { MWFNode child = getNode (nexts[i].getAD_WF_Next_ID()); - if (!child.isActive()) + if (child == null || !child.isActive()) continue; if (child.getAD_Client_ID() == 0 || child.getAD_Client_ID() == AD_Client_ID)