From 0899c5f4864d1c5ab15e325211617d7b3c23e07e Mon Sep 17 00:00:00 2001 From: danielaparker Date: Sun, 23 Jan 2022 07:11:56 -0500 Subject: [PATCH] Improve error handling --- include/jsoncons/decode_traits.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/jsoncons/decode_traits.hpp b/include/jsoncons/decode_traits.hpp index e743c57125..d237b323cf 100644 --- a/include/jsoncons/decode_traits.hpp +++ b/include/jsoncons/decode_traits.hpp @@ -457,9 +457,9 @@ namespace jsoncons { for (std::size_t i = 0; i < N && cursor.current().event_type() != staj_event_type::end_array && !ec; ++i) { v[i] = decode_traits::decode(cursor, decoder, ec); - if (ec) {return T{};} + if (ec) {return v;} cursor.next(ec); - if (ec) {return T{};} + if (ec) {return v;} } return v; }