Skip to content

Commit

Permalink
CPPSDK: ensure array has enough data before trying to access (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul authored Apr 8, 2024
1 parent 97fc800 commit 76fa0ec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions languages/cpp/templates/result-instantiation/tuple.cpp
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
${property}.first = jsonResult.Get(0);
${property}.second = jsonResult.Get(1);
ASSERT((jsonResult.Length() == 0) || (jsonResult.Length() == 2));
if (jsonResult.Length() == 2) {
${property}.first = jsonResult.Get(0);
${property}.second = jsonResult.Get(1);
}

0 comments on commit 76fa0ec

Please sign in to comment.