diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-08-26 11:24:17 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-08-26 11:24:17 +0200 |
commit | 600b2ff02ff7727156df17742f1468aefdbcea9c (patch) | |
tree | 9f93099e40de42c44b48e93ebe61032c3a55e407 /src/Response.cpp | |
parent | 2f8ff5fc79e394b95bafdb5931f2cdddb8a7ae1c (diff) | |
download | n_core-600b2ff02ff7727156df17742f1468aefdbcea9c.tar.gz n_core-600b2ff02ff7727156df17742f1468aefdbcea9c.zip |
fix missing termination statement for annotation recursion
Diffstat (limited to 'src/Response.cpp')
-rw-r--r-- | src/Response.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |