From d5252a45d37ad2b61c77bf808777ab4f14a42f6a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 28 May 2022 20:33:05 -0500 Subject: [PATCH] [ox/oc] Make write omit lists if length is 0 --- deps/ox/src/ox/oc/write.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/ox/src/ox/oc/write.hpp b/deps/ox/src/ox/oc/write.hpp index 1073238b..79713591 100644 --- a/deps/ox/src/ox/oc/write.hpp +++ b/deps/ox/src/ox/oc/write.hpp @@ -89,7 +89,7 @@ class OrganicClawWriter { template Error OrganicClawWriter::field(const char *key, T *val, std::size_t len) noexcept { - if (targetValid()) { + if (targetValid() && len) { OrganicClawWriter w((Json::Value(Json::arrayValue))); for (std::size_t i = 0; i < len; ++i) { oxReturnError(w.field("", &val[i]));