Check length of cancellation reason list before getting reason codes

This commit is contained in:
Jon Chambers
2021-11-09 11:42:44 -05:00
committed by GitHub
parent bae0196bcf
commit 1e1394560d
2 changed files with 25 additions and 1 deletions

View File

@@ -387,7 +387,7 @@ public class Accounts extends AbstractDynamoDbStore {
} catch (final TransactionCanceledException e) {
if ("ConditionalCheckFailed".equals(e.cancellationReasons().get(1).code())) {
if (e.cancellationReasons().size() > 1 && "ConditionalCheckFailed".equals(e.cancellationReasons().get(1).code())) {
log.error("Conflicting phone number mapping exists for account {}, PNI {}", account.getUuid(), account.getPhoneNumberIdentifier());
throw e;
}