diff --git a/base/src/org/adempiere/pipo/AbstractElementHandler.java b/base/src/org/adempiere/pipo/AbstractElementHandler.java index e24fadb22d..c3e45ef329 100644 --- a/base/src/org/adempiere/pipo/AbstractElementHandler.java +++ b/base/src/org/adempiere/pipo/AbstractElementHandler.java @@ -258,10 +258,10 @@ public abstract class AbstractElementHandler implements ElementHandler { int idDetail = DB.getSQLValue(getTrxName(ctx),sqlD.toString())+1; if (referenceID == 10 || referenceID == 14 || referenceID == 34 || referenceID == 17) - if (from.get_Value(i)!= null) + if (from != null && from.get_Value(i)!= null) colValue = from.get_Value(i).toString().replaceAll("'","''"); else if (referenceID == 20|| referenceID == 28) - if (from.get_Value(i)!= null) + if (from != null && from.get_Value(i)!= null) colValue = from.get_Value(i).toString().replaceAll("'","''"); else ;//Ignore @@ -281,7 +281,7 @@ public abstract class AbstractElementHandler implements ElementHandler { .append( ", " + tableID ) .append( ", " + (columnID == -1 ? "null" : columnID) ) .append( ", " + (referenceID == -1 ? "null" : referenceID) ) - .append( ", '" + (colValue != null ? colValue : from.get_Value(i)) ) + .append( ", '" + (colValue != null ? colValue : (from != null ? from.get_Value(i) : "null")) ) .append( "')"); int no = DB.executeUpdate (sqlB.toString(), getTrxName(ctx)); diff --git a/base/src/org/adempiere/pipo/handler/DataElementHandler.java b/base/src/org/adempiere/pipo/handler/DataElementHandler.java index a824354edf..974d2d2e78 100644 --- a/base/src/org/adempiere/pipo/handler/DataElementHandler.java +++ b/base/src/org/adempiere/pipo/handler/DataElementHandler.java @@ -162,6 +162,8 @@ public class DataElementHandler extends AbstractElementHandler { int id = get_ID(ctx, d_tablename, nameAttribute); genericPO = table.getPO(id, getTrxName(ctx)); if (id > 0){ + if (genericPO == null || genericPO.get_ID() != id) + throw new SAXException("id not found"); AD_Backup_ID = copyRecord(ctx,d_tablename,genericPO); objectStatus = "Update"; }