IDEMPIERE-5849:MRole.getDefault make phantom role on cache (#2020)

patch from Heng Sin

Co-authored-by: hengsin <hengsin@gmail.com>
This commit is contained in:
hieplq 2023-09-22 13:17:34 +07:00 committed by GitHub
parent 3992f46b04
commit d28c6eb9d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -88,6 +88,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport
*/
public static MRole getDefault (Properties ctx, boolean reload)
{
if (Util.isEmpty(Env.getContext(ctx, Env.AD_ROLE_ID)) || Util.isEmpty(Env.getContext(ctx, Env.AD_USER_ID)))
return null;
int AD_Role_ID = Env.getContextAsInt(ctx, Env.AD_ROLE_ID);
int AD_User_ID = Env.getContextAsInt(ctx, Env.AD_USER_ID);

View File

@ -917,7 +917,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
* @return true if preference dialog is available and accessible
*/
protected boolean isShowPreference() {
return MRole.getDefault().isShowPreference() && gridField != null && !gridField.isEncrypted() && !gridField.isEncryptedColumn() && !gridField.isVirtualColumn();
return MRole.getDefault() != null && MRole.getDefault().isShowPreference() && gridField != null && !gridField.isEncrypted()
&& !gridField.isEncryptedColumn() && !gridField.isVirtualColumn();
}
/**