Skip to content

Commit

Permalink
fix npe session
Browse files Browse the repository at this point in the history
  • Loading branch information
Thumimku committed Mar 1, 2024
1 parent 280b775 commit 2b863e8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;

import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.LOCAL_IDP_NAME;

/**
* Class to store and retrieve user related data.
*/
Expand Down Expand Up @@ -298,7 +300,10 @@ public int getIdPId(String idPName) throws UserSessionException {
public int getIdPId(String idpName, int tenantId) throws UserSessionException {

int idPId = -1;
if (idpName.equals("LOCAL")) {
if (StringUtils.isBlank(idpName)) {
throw new UserSessionException("Blank IDP Name is provided to retrieve IdP id of tenant ID: " + tenantId);
}
if (StringUtils.equals(LOCAL_IDP_NAME, idpName)) {
return idPId;
}
try (Connection connection = IdentityDatabaseUtil.getDBConnection(false)) {
Expand Down

0 comments on commit 2b863e8

Please sign in to comment.