diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index fbf2e7aca9..5dcbd35d88 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -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); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java index dfefa9a565..f162d6c004 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java @@ -917,7 +917,8 @@ public abstract class WEditor implements EventListener, 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(); } /**