Skip to content

fix: tokenAssociate throws IndexOutOfBoundsException #12552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@ protected void createAndLinkTokenRels(
@NonNull final WritableTokenRelationStore tokenRelStore) {
// create list of token relations to be added
final var newTokenRels = createTokenRelsToAccount(account, tokens);
// Link the new token relations to the account
linkTokenRels(account, newTokenRels, tokenRelStore);

// FUTURE - We may need to return a proper error status when tokens are empty
if (!newTokenRels.isEmpty()) {
// Link the new token relations to the account
linkTokenRels(account, newTokenRels, tokenRelStore);

// Now replace the account's old head token number with the new head token number. This is
// how we link the new tokenRels to the account
final var firstOfNewTokenRels = newTokenRels.get(0);
Expand Down
Loading