IDEMPIERE-5276 : NPE on MInfoWindow.get (#1303)

This commit is contained in:
Nicolas Micoud 2022-04-26 10:42:55 +02:00 committed by GitHub
parent f784d469b4
commit 00c112b263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -48,7 +48,7 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport
/**
*
*/
private static final long serialVersionUID = 6723480469706009814L;
private static final long serialVersionUID = -6793583766286122866L;
/** Cache */
private static ImmutablePOCache<String,MInfoWindow> s_cache = new ImmutablePOCache<String,MInfoWindow>(Table_Name, 20);
@ -222,12 +222,16 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport
* */
public static MInfoWindow get(int infoWindowID, String trxName) {
MInfoWindow iw = getInfoWindow(infoWindowID);
if (iw != null) {
Boolean access = MRole.getDefault().getInfoAccess(iw.getAD_InfoWindow_ID());
if (access != null && access.booleanValue()) {
if (!Util.isEmpty(trxName, true))
iw = new MInfoWindow(iw, trxName);
return iw;
}
}
return null;
}