IDEMPIERE-3101 implement OAuth2 for mail (gmail, outlook and other mail system) (#613)

* Avoid NPE when calling the servlet without parameters
This commit is contained in:
Carlos Ruiz 2021-03-06 16:22:31 +01:00 committed by GitHub
parent 371afa054a
commit c03fefea79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -105,11 +105,11 @@ public class OAuthCodeCallbackHandlerServlet extends HttpServlet {
}
}
Env.getCtx().setProperty(Env.AD_CLIENT_ID, String.valueOf(pinstance.getAD_Client_ID())); // To avoid Context Lost exception
Env.getCtx().setProperty(Env.AD_USER_ID, String.valueOf(pinstance.getCreatedBy())); // To set as CreatedBy of the account
MAuthorizationCredential credential = null;
MPInstancePara paramAnswer = null;
if (errmsg == null) {
Env.getCtx().setProperty(Env.AD_CLIENT_ID, String.valueOf(pinstance.getAD_Client_ID())); // To avoid Context Lost exception
Env.getCtx().setProperty(Env.AD_USER_ID, String.valueOf(pinstance.getCreatedBy())); // To set as CreatedBy of the account
for (MPInstancePara param : pinstance.getParameters()) {
if (MAuthorizationCredential.COLUMNNAME_AD_AuthorizationCredential_ID.equals(param.getParameterName()))
credential = new MAuthorizationCredential(Env.getCtx(), param.getP_Number().intValue(), null);