contrib: force (de)serialization to create params section incase there is none.

Co-authored-by: Boog900 <boog900@tutanota.com>
This commit is contained in:
0xFFFC0000 2024-12-13 19:49:55 +00:00
parent 58a1d54a4f
commit 13df862535
2 changed files with 75 additions and 0 deletions

View file

@ -171,6 +171,13 @@
epee::serialization::store_t_to_json(static_cast<epee::json_rpc::error_response&>(rsp), response_info.m_body); \
return true; \
} \
epee::serialization::storage_entry params_; \
params_ = epee::serialization::storage_entry(epee::serialization::section()); \
if(!ps.get_value("params", params_, nullptr)) \
{ \
epee::serialization::section params_section; \
ps.set_value("params", std::move(params_section), nullptr); \
} \
if(false) return true; //just a stub to have "else if"