Skip to content

Commit

Permalink
add size guard
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed Mar 4, 2023
1 parent 9f38cb9 commit e8e0d8b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ripple/rpc/impl/NFTokenID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,18 @@ insertNFTokenID(
if (auto const type = transaction->getTxnType(); type == ttNFTOKEN_MINT)
{
getNFTokenIDFromPage(transactionMeta, tokenIDResult);
response[jss::nftoken_id] = to_string(tokenIDResult.front());

if (tokenIDResult.size() > 0)
response[jss::nftoken_id] = to_string(tokenIDResult.front());
}
else if (type == ttNFTOKEN_ACCEPT_OFFER)
{
getNFTokenIDFromDeletedOffer(transactionMeta, tokenIDResult);

// In brokered mode, there will be a duplicate NFTokenID in the
// vector, but we don't have to do anything special here.
response[jss::nftoken_id] = to_string(tokenIDResult.front());
if (tokenIDResult.size() > 0)
response[jss::nftoken_id] = to_string(tokenIDResult.front());
}
else if (type == ttNFTOKEN_CANCEL_OFFER)
{
Expand Down

0 comments on commit e8e0d8b

Please sign in to comment.