Skip to content

Commit

Permalink
Fix #1238: NullPointerException in Activation Retrieval Method (#1239)
Browse files Browse the repository at this point in the history
* Fix #1238: NullPointerException in Activation Retrieval Method
- Prevent possible NullPointerException when fetching activation flags
  • Loading branch information
jandusil authored Jan 5, 2024
1 parent 97ddc21 commit 5cbb6b1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.wultra.security.powerauth.client.model.response.OperationListResponse;
import com.wultra.security.powerauth.client.model.response.OperationUserActionResponse;
import io.getlime.security.powerauth.app.server.configuration.PowerAuthServiceConfiguration;
import io.getlime.security.powerauth.app.server.database.model.entity.ActivationRecordEntity;
import io.getlime.security.powerauth.app.server.database.model.entity.ApplicationEntity;
import io.getlime.security.powerauth.app.server.database.model.entity.OperationEntity;
import io.getlime.security.powerauth.app.server.database.model.entity.OperationTemplateEntity;
Expand Down Expand Up @@ -895,8 +896,11 @@ private static Optional <UserAgent.Device> parseDeviceFromUserAgent(Map<String,
private List<String> fetchActivationFlags(String activationId) {
if (activationId != null) {
logger.debug("Searching for operations with activationId: {}", activationId);
final List<String> flags = activationRepository.findActivationWithoutLock(activationId).getFlags();
return flags != null ? flags : Collections.emptyList();
final ActivationRecordEntity activationRecord = activationRepository.findActivationWithoutLock(activationId);
if (activationRecord != null) {
final List<String> flags = activationRecord.getFlags();
return flags != null ? flags : Collections.emptyList();
}
}
return Collections.emptyList();
}
Expand Down

0 comments on commit 5cbb6b1

Please sign in to comment.