IDEMPIERE-4572 Fix NPE (#402)

This commit is contained in:
Orlando Curieles 2020-11-21 20:49:29 -05:00 committed by GitHub
parent 7a957d8148
commit b05b26d9f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Properties;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.util.Env;
import org.compiere.util.TimeUtil;
import org.idempiere.cache.ImmutableIntPOCache;
@ -130,6 +131,10 @@ public class MAssetAcct extends X_A_Asset_Acct implements ImmutablePOSupport
.setParameters(params)
.setOrderBy(COLUMNNAME_ValidFrom+" DESC NULLS LAST")
.first();
if (acct == null)
throw new AdempiereException("@NoAccountOrgCurrency@");
if (acct.get_ID() > 0)
{
s_cache.put(acct.get_ID(), acct, e -> new MAssetAcct(Env.getCtx(), e));