Check length of cancellation reason list before getting reason codes

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

No files matched your search

@@ -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;
}