From f681c282d45526cb927d70ca7155b87aa3f6b960 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Mon, 8 Apr 2024 06:08:26 -0400 Subject: [PATCH] CPPSDK: ensure array has enough data before trying to access --- languages/cpp/templates/result-instantiation/tuple.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/languages/cpp/templates/result-instantiation/tuple.cpp b/languages/cpp/templates/result-instantiation/tuple.cpp index c94a7054..9ba6f3af 100644 --- a/languages/cpp/templates/result-instantiation/tuple.cpp +++ b/languages/cpp/templates/result-instantiation/tuple.cpp @@ -1,2 +1,5 @@ - ${property}.first = jsonResult.Get(0); - ${property}.second = jsonResult.Get(1); \ No newline at end of file + ASSERT((jsonResult.Length() == 0) || (jsonResult.Length() == 2)); + if (jsonResult.Length() == 2) { + ${property}.first = jsonResult.Get(0); + ${property}.second = jsonResult.Get(1); + }