From 600b2ff02ff7727156df17742f1468aefdbcea9c Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Wed, 26 Aug 2020 11:24:17 +0200 Subject: fix missing termination statement for annotation recursion --- src/Response.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Response.cpp b/src/Response.cpp index d7006c9..286de52 100644 --- a/src/Response.cpp +++ b/src/Response.cpp @@ -10,7 +10,11 @@ Response::json Response::simple_response(std::string const &text, std::string co Response::json Response::create_annotation(Reply::AnnotationType annotationType, std::string const &extra) { json annotation(crow::json::type::Object); annotation["type"] = Reply::GetStringAnnotationType(annotationType); - annotation["extra"] = create_text(extra); + if (extra.empty()) { + annotation["extra"] = json(crow::json::type::List); + } else { + annotation["extra"] = create_text(extra); + } return annotation; } -- cgit v1.2.3-54-g00ecf